Mercurial > vim
changeset 13119:729f279fda8d v8.0.1434
patch 8.0.1434: GTK: :promtfind does not put focus on text input
commit https://github.com/vim/vim/commit/d7823d5b7c32f73ca720373ea9c16b1b47f086df
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 28 15:36:42 2018 +0100
patch 8.0.1434: GTK: :promtfind does not put focus on text input
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 28 Jan 2018 15:45:05 +0100 |
parents | d2720676b789 |
children | 9a04f8e88adc |
files | src/gui_gtk.c src/version.c |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -2193,6 +2193,15 @@ find_replace_dialog_create(char_u *arg, #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; }