[Xfce4-commits] <xfce-utils:completion> Move the cursor at the end of entry after completion.

Jérôme Guelfucci noreply at xfce.org
Wed Nov 3 21:04:10 CET 2010


Updating branch refs/heads/completion
         to cd5372371dcf6479d55611259cf613efb059997d (commit)
       from eb89a1cdeb78940fcd84640f0c81d30dd970f86c (commit)

commit cd5372371dcf6479d55611259cf613efb059997d
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Sun Oct 31 23:50:48 2010 +0100

    Move the cursor at the end of entry after completion.

 xfrun/xfrun-dialog.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/xfrun/xfrun-dialog.c b/xfrun/xfrun-dialog.c
index 70ea839..619edef 100644
--- a/xfrun/xfrun-dialog.c
+++ b/xfrun/xfrun-dialog.c
@@ -258,6 +258,7 @@ xfrun_dialog_key_press_event(GtkWidget *widget,
             gtk_entry_set_text(GTK_ENTRY(dialog->priv->entry), item->command);
             gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (dialog->priv->terminal_chk),
                                          item->in_terminal);
+            gtk_editable_set_position (GTK_EDITABLE(dialog->priv->entry), -1);
             dialog->priv->in_history_cycle = TRUE;
         }
 
@@ -271,6 +272,7 @@ xfrun_dialog_key_press_event(GtkWidget *widget,
             gtk_entry_set_text(GTK_ENTRY(dialog->priv->entry), item->command);
             gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (dialog->priv->terminal_chk),
                                          item->in_terminal);
+            gtk_editable_set_position (GTK_EDITABLE(dialog->priv->entry), -1);
         }
 
         return TRUE;
@@ -286,22 +288,24 @@ xfrun_dialog_key_press_event(GtkWidget *widget,
         }
 
         if(item) {
-          gtk_entry_set_text(GTK_ENTRY(dialog->priv->entry), item->command);
-          gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (dialog->priv->terminal_chk),
-                                       item->in_terminal);
-          dialog->priv->in_history_completion = TRUE;
+            gtk_entry_set_text(GTK_ENTRY(dialog->priv->entry), item->command);
+            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->priv->terminal_chk),
+                                         item->in_terminal);
+            gtk_editable_set_position (GTK_EDITABLE(dialog->priv->entry), -1);
+            dialog->priv->in_history_completion = TRUE;
         }
 
         return TRUE;
     } else if(evt->keyval == GDK_Page_Down && dialog->priv->in_history_completion) {
         XfrunHistoryItem *item;
 
-        item = xfrun_history_completion_previous (dialog->priv->history);
+        item = xfrun_history_completion_previous(dialog->priv->history);
 
         if(item) {
-          gtk_entry_set_text(GTK_ENTRY(dialog->priv->entry), item->command);
-          gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (dialog->priv->terminal_chk),
-                                       item->in_terminal);
+            gtk_entry_set_text(GTK_ENTRY(dialog->priv->entry), item->command);
+            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (dialog->priv->terminal_chk),
+                                         item->in_terminal);
+            gtk_editable_set_position (GTK_EDITABLE(dialog->priv->entry), -1);
         }
 
         return TRUE;



More information about the Xfce4-commits mailing list