From 81aca38adc5c0464aea327967d153346949bb6fb Mon Sep 17 00:00:00 2001 From: Alexandre De Dommelin Date: Sun, 12 Mar 2017 15:49:46 -0700 Subject: selectoption # Description: add "Selected" config option # Author: Fernando Vezzosi Gbp-Pq: Name 80-selectoption.patch --- src/main.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index b234bc5..649490c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -615,6 +615,10 @@ int main(int argc, char **argv) if (!configuration.get_int("ShowLast", shows_last_history_item)) { shows_last_history_item = 0; } + int last_history_selected = 0; + if (!configuration.get_int("Selected", last_history_selected)) { + last_history_selected = 1; + } if (shows_last_history_item) { gtk_completion_line_last_history_item(GTK_COMPLETION_LINE(compline)); } @@ -662,7 +666,11 @@ int main(int argc, char **argv) gtk_widget_show(win); - gtk_window_set_focus(GTK_WINDOW(win), compline); + if(last_history_selected){ + gtk_entry_select_region(GTK_ENTRY(compline), 0, strlen(gtk_entry_get_text(GTK_ENTRY(compline)))); + }else{ + gtk_entry_set_position(GTK_ENTRY(compline), -1); + } gtk_main(); } -- cgit v1.2.3