Simon Lydell [Mon, 30 Dec 2013 11:02:45 +0000 (12:02 +0100)]
Make button click depend on current mode. Fix #243
Both insert mode and disabled mode use the same greyed out icon for the
toolbar button. If you're in insert mode and click the button, we used to
disable the extension as normal. However, it felt like clicking the button
did nothing, because the icon didn't change. Even if it _would_ change, it
feels more natural if the extension is _enabled_ again at that point. So
now, if you're in insert mode and click the button, we enter normal mode.
(#243)
If the current site is blacklisted, clicking the button used to disable
the extension. Well, it was already disabled, but the button icon changed
from the blacklisted icon (red) to the disabled icon (grey). Clicking
again went back to blacklisted mode. That's pretty weird. Now we open the
menu popup when clicked instead, which will show the trash can icon which
is used to un-blacklist the site. Un-blacklisting directly when clicking
the button would be to go too far, since that can potentially remove more
blacklisting rules than the user wants to. Using the popup you have a
chance to review what will be removed when un-blacklisting.
To sum up, the button clicking is more intuitive now:
- If enabled: Disable
- Otherwise: Enable (almost)
Simon Lydell [Sun, 15 Dec 2013 18:48:11 +0000 (19:48 +0100)]
Always open regular find bar, not last used
There are three find bars: The "regular" one, the "quick find" one and the
"quick find (link only)" one. Before, the VimFx `/` command opened the one
of those three that was used last. Now, the regular is always opened.
Simon Lydell [Sat, 14 Dec 2013 11:56:54 +0000 (12:56 +0100)]
Auto-focus findbar in find mode onInput
Now, if you unfocus the text input of the findbar, it will be
automatically focused again when you start typing. Before, nothing at all
happened (commands weren't run either), which felt really weird. This
reminds you that you're still in find mode, and need to press Enter or Esc
to exit from it.
Simon Lydell [Tue, 1 Oct 2013 11:35:13 +0000 (13:35 +0200)]
Make command_Esc in charge of all "escaping"
To be able to exit modes or blur text inputs, you _had_ to use Esc before.
It was hard coded. Now, changing the shortcut for command_Esc works as
expected.
Simon Lydell [Wed, 11 Sep 2013 20:24:01 +0000 (22:24 +0200)]
Let un-blacklist remove _all_ matching rules
Previously, only the _first_ matching rule was removed when the user
clicked the "un-blacklist button". But it would be a bummer if the user
clicks to remove the page from the blacklist, and it stays blacklisted.
Therefore _all_ matching rules are displayed and removed. To facilitate
this, the string in the textbox of the toolbar button is treated as a
blacklist of its own, which should be removed from or concatenated with
the blacklist pref. (Which means that the user is now able to add multiple
rules at the same time, should anyone want that.)
Simon Lydell [Tue, 10 Sep 2013 14:29:24 +0000 (16:29 +0200)]
Fix #190: Improve blacklisting UI
- Fix bug: on `about:` pages `**` was suggested as blacklisting rule
- On blacklisted pages, the blacklist button un-blacklists instead
- Live validation of the black list setting
Simon Lydell [Tue, 10 Sep 2013 10:40:34 +0000 (12:40 +0200)]
Fix #192: Clarify customization is in help dialog
- Add button in settings page to customize keyboard shortcuts (open the
help dialog)
- Change "Help" to "Keyboard shortcuts"
- Fix bug: Help dialog broke the layout in XUL pages
Simon Lydell [Sat, 7 Sep 2013 20:56:50 +0000 (22:56 +0200)]
Fix: Dropped out of insert mode on location change
For example, it would be nice to usually be in insert mode in gmail, and
only occasionally leave it. However, as soon as you for example went from
the inbox to an e-mail, the location changed, which caused normal mode to
be entered. Only when in hints mode we need to do that (issue #101).
Simon Lydell [Sat, 7 Sep 2013 18:32:31 +0000 (20:32 +0200)]
Fix: `Vim::enterNormalMode` should reset `@keys`
Otherwise keys accumulated in other modes might be interpreted when going
back to normal mode. For example, following a link with a hint ending with
"a" and then directly trying to follow another link, would do so in a new
tab. That last "a" was still in `@keys` when returning to normal mode, so
when trying to use the "f" command, it was interpreted as "af" instead.
Simon Lydell [Sat, 7 Sep 2013 00:30:08 +0000 (02:30 +0200)]
Refactor modes.coffee by grouping all hints files
There was too much code in modes.coffee, making it hard to extend in the
future. It simply requires mode-hints.coffee. However, adding _yet_ a new
file for the hints was one too much, so I group all hints-related files in
a folder called mode-hints.
Simon Lydell [Fri, 6 Sep 2013 23:01:46 +0000 (01:01 +0200)]
Refactor Esc key handling
This includes refactoring of events.coffee and vim.coffee.
The Vim class no longer handles any events. It is just given a `keyStr` in
its `onInput` method. Then it handles that `keyStr`, and reports back if
it was of any use: It matched a command or was used by some mode. That
information is then used in events.coffee to determine if the event should
be suppressed or not.
All events.coffee does now (in the keydown/keypress/keyup handler) is
determine if it should run vim and if it should suppress the event. The
blurring of XUL controls has been moved to commands.coffee, where it
belongs.
Moreover, the Esc key now does two things by default, but only one at a
time. If we're in normal mode, it runs `command_Esc`. Otherwise it calls
`vim.enterNormalMode()`. This allows us to cancel hint markers on dialogs
(such as the help dialog) without closing the dialog (dialogs are often
closed when Esc is pressed).
Simon Lydell [Thu, 5 Sep 2013 19:14:48 +0000 (21:14 +0200)]
Slight `Vim::handleKeyDown` refactor
Incidentally, the refactor solved a bug I just found. Before, you could
not have a custom shortcut such as `zvfa` without triggering the `vf`
command, or `zo` without triggering the `o` command.