]> git.gir.st - VimFx.git/commit
Improve find mode. Fix #342. Better Esc handling.
authorSimon Lydell <simon.lydell@gmail.com>
Sun, 15 Jun 2014 14:10:52 +0000 (16:10 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Sun, 15 Jun 2014 14:10:52 +0000 (16:10 +0200)
commit2645bb161e7a3ac89479110d0da21d98c1969649
tree26fe456f874eedad81fea7041598cb40530e9711
parent540ad457141fb762497d3b303da221908a425402
Improve find mode. Fix #342. Better Esc handling.

Previously, find mode only worked if you used VimFx's shortcuts to enter
it. If you opened the find bar some other way, you weren't able to end
the search using Enter, and the n/N commands wouldn't repeat what you
just searched for.  Now, find mode is entered as soon as the findbar
input gets focused, no matter how it was focused. Find mode is also
exited as soon as the findbar input is blurred. Previously, if you
happened to unfocus the findbar without using Esc or Enter, such as
clicking or tabbing away, then you'd still be in find mode, making all
keypresses focus the findbar input rather than activate commands.

If the active element is editable during a keypress we used to pass that
keypress along to the browser -- regardless of the current mode --
instead of activating commands. The findbar input is also an editable
element, but when it is focused we want Enter to close the findbar.
Therefore we used to not pass along Enter to the browser. If the user
mapped Enter to a command, that meant that it would be impossible to
press enter in an input to type a newline, submit a search query, etc.
Now, we only use this automatic insert mode in normal mode instead.

The above also fixed another problem. We used to always pass Esc to the
browser in normal mode, even if Esc is mapped to a command. Now, that is
not done if we’re blurring an element. That makes it possible to blur an
input inside a custom dialog without closing it (Esc almost always
closes custom dialogs).  This makes it possible to use devdocs.io with
VimFx, which was very difficult before.
extension/packages/commands.coffee
extension/packages/events.coffee
extension/packages/modes.coffee
extension/packages/utils.coffee
extension/packages/vim.coffee
Imprint / Impressum