Skip to content

Commit

Permalink
Made history cycle behave more like console
Browse files Browse the repository at this point in the history
git-svn-id: http://sanoi.webfactional.com/trunk@114 79def182-f41f-0410-b320-e94a04284523
  • Loading branch information
mario committed Oct 20, 2007
1 parent 04424f5 commit cf0a062
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/ui-history.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,37 +260,41 @@ gboolean
famahistory_command_loadpre()
{
HIST_ENTRY *he;
gint offset, totalcnt;
gint offset, totalcnt;
totalcnt = famahistory_number();
offset = famahis.currentpos;// where_history();
offset--;
if (offset == history_base - 1)
offset = totalcnt + history_base;

he = famahistory_get(offset);
if (he)
if (he) {
commandline_set_cmd(he->line);
else
famahis.currentpos = offset;
}
else {
commandline_set_cmd(NULL);
famahis.currentpos = offset;
famahis.currentpos = history_base - 1;
}
return TRUE;
}

gboolean
famahistory_command_loadnext()
{
HIST_ENTRY *he;
gint offset, totalcnt;
gint offset, totalcnt;
totalcnt = famahistory_number();
offset = famahis.currentpos;// where_history();
offset++;
if (offset == history_base + totalcnt + 1)
offset = history_base;

he = famahistory_get(offset);
if (he)
if (he) {
commandline_set_cmd(he->line);
else
famahis.currentpos = offset;
}
else {
commandline_set_cmd(NULL);
famahis.currentpos = offset;
famahis.currentpos = totalcnt;
}
return TRUE;
}

Expand Down

0 comments on commit cf0a062

Please sign in to comment.