]> granicus.if.org Git - vim/commitdiff
patch 8.0.1434: GTK: :promtfind does not put focus on text input v8.0.1434
authorBram Moolenaar <Bram@vim.org>
Sun, 28 Jan 2018 14:36:42 +0000 (15:36 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 28 Jan 2018 14:36:42 +0000 (15:36 +0100)
Problem:    GTK: :promtfind does not put focus on text input. (Adam Novak)
Solution:   When re-opening the dialog put focus on the text input. (Kazunobu
            Kuriyama, closes #2563)

src/gui_gtk.c
src/version.c

index b321da0d580215dcfd0182e3afc08860ee7f5af7..c1b0479749b9b1ba5024b7062ec13a6e64a29bcd 100644 (file)
@@ -2193,6 +2193,15 @@ find_replace_dialog_create(char_u *arg, int do_replace)
 #endif
        }
        gtk_window_present(GTK_WINDOW(frdp->dialog));
+
+       /* For :promptfind dialog, always give keyboard focus to 'what' entry.
+        * For :promptrepl dialog, give it to 'with' entry if 'what' has an
+        * non-empty entry; otherwise, to 'what' entry. */
+       gtk_widget_grab_focus(frdp->what);
+       if (do_replace && gtk_entry_get_text_length(GTK_ENTRY(frdp->what)))
+           gtk_widget_grab_focus(frdp->with);
+
+
        vim_free(entry_text);
        return;
     }
index 6ebb01a39653273d063d6c963f9456ca144c8425..bace9d3c6448dbea3fd87bbec42abc637a55fff6 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1434,
 /**/
     1433,
 /**/