summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre De Dommelin <adedommelin@tuxz.net>2017-03-12 15:49:46 -0700
committerLukas Schwaighofer <lukas@schwaighofer.name>2017-03-12 15:49:46 -0700
commit81aca38adc5c0464aea327967d153346949bb6fb (patch)
tree54c8a64f0b7c5816f866b77bd8eb5fb46dd5a30d
parentf8d570423a8f9b422408c7a0ee66b6df283e3498 (diff)
selectoption
# Description: add "Selected" config option # Author: Fernando Vezzosi <fv@linuxvar.it> Gbp-Pq: Name 80-selectoption.patch
-rw-r--r--src/main.cc10
1 files changed, 9 insertions, 1 deletions
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();
}