diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 5f96d30f..62ea83fb 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -158,6 +158,9 @@ void gui_entry_set_pos(int p) { if (p >= 0 && p <= entry->len) pos = p; + + entry_screenpos(); + entry_update(); } void gui_entry_move_pos(int p) diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index 10d54c86..8aa7b0a7 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -160,12 +160,10 @@ void handle_key(int key) case KEY_HOME: /* home */ gui_entry_set_pos(0); - gui_entry_move_pos(0); break; case KEY_END: /* end */ gui_entry_set_pos(strlen(gui_entry_get_text())); - gui_entry_move_pos(0); break; case KEY_PPAGE: /* page up */ @@ -223,7 +221,6 @@ void handle_key(int key) c = gui_entry_get_pos(); gui_entry_set_pos(strlen(gui_entry_get_text())); gui_entry_erase(strlen(gui_entry_get_text()) - c); - gui_entry_move_pos(0); break; case 0: @@ -232,12 +229,10 @@ void handle_key(int key) case 1: /* C-A, home */ gui_entry_set_pos(0); - gui_entry_move_pos(0); break; case 5: /* C-E, end */ gui_entry_set_pos(strlen(gui_entry_get_text())); - gui_entry_move_pos(0); break; case '\n':