diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-01-28 15:36:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-01-28 15:36:42 +0100 |
commit | d7823d5b7c32f73ca720373ea9c16b1b47f086df (patch) | |
tree | 48b1e9e14cb1c8bdad57ac3f008c007477a196a9 /src/gui_gtk.c | |
parent | 95dbcbea6d85a5b79d9617ab3863458fdf0217a0 (diff) | |
download | vim-git-d7823d5b7c32f73ca720373ea9c16b1b47f086df.tar.gz |
patch 8.0.1434: GTK: :promtfind does not put focus on text inputv8.0.1434
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)
Diffstat (limited to 'src/gui_gtk.c')
-rw-r--r-- | src/gui_gtk.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui_gtk.c b/src/gui_gtk.c index b321da0d5..c1b047974 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -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; } |