From ce2f577578ff7795e7bb13d206e12fe9ef84a4c2 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Fri, 12 Nov 1999 23:32:49 +0000 Subject: [PATCH] Fri Nov 12 15:57:40 PST 1999 (KainX) Wrap-around history. SVN revision: 1285 --- ChangeLog | 7 +++++++ api/epplet.c | 1 + epplets/E-Exec.c | 33 ++++++++++++++++++++++++--------- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 426098b..e100895 100644 --- a/ChangeLog +++ b/ChangeLog @@ -521,3 +521,10 @@ Fri Nov 12 15:37:46 PST 1999 (KainX) Some UI changes to make E-Exec a little more friendly. :-) + +------------------------------------------------------------------------------- + +Fri Nov 12 15:57:40 PST 1999 +(KainX) + +Wrap-around history. diff --git a/api/epplet.c b/api/epplet.c index 035360e..0a58dbd 100644 --- a/api/epplet.c +++ b/api/epplet.c @@ -1470,6 +1470,7 @@ Epplet_reset_textbox(Epplet_gadget eg) g->contents = NULL; } g->cursor_pos = g->text_offset = 0; + Epplet_draw_textbox(eg); } void diff --git a/epplets/E-Exec.c b/epplets/E-Exec.c index 334d699..6c76ed6 100644 --- a/epplets/E-Exec.c +++ b/epplets/E-Exec.c @@ -55,8 +55,15 @@ run_contents(void *data) static void hist_last(void *data) { - if (current_command > 0) - Epplet_change_textbox(textbox, command_history[--current_command]); + if (current_command == 0) + { + current_command = num_commands; + Epplet_reset_textbox(textbox); + } + else + { + Epplet_change_textbox(textbox, command_history[--current_command]); + } return; data = NULL; @@ -65,13 +72,21 @@ hist_last(void *data) static void hist_next(void *data) { - if (current_command < num_commands-1) - Epplet_change_textbox(textbox, command_history[++current_command]); - else if(current_command == num_commands-1) - { - current_command++; - Epplet_change_textbox(textbox, ""); - } + if (current_command == num_commands - 1) + { + current_command++; + Epplet_reset_textbox(textbox); + return; + } + else if (current_command >= num_commands) + { + current_command = 0; + } + else + { + current_command++; + } + Epplet_change_textbox(textbox, command_history[current_command]); return; data = NULL;