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.
The conflicts above required some refactoring to be resolved. Instead of
doing _just_ the refactoring required to get the code runnning again, I
continued with related refactoring, since it felt more sensible.
Simon Lydell [Wed, 4 Sep 2013 22:30:15 +0000 (00:30 +0200)]
Move `z-index` out of `.VimFxReset`
The hint markers need to set `z-index` dynamically (to rotate overlapping
markers). style.css is inserted as an agent sheet and uses `!important`
everywhere (this is needed to override userstyles, see commit 6145382),
and can therefore not be overrided by inline styles.
Therefore, I've moved `z-index` out of `.VimFxReset`, to each place that
actually _needs_ it: A few positioned elements.
Simon Lydell [Sat, 31 Aug 2013 23:16:48 +0000 (01:16 +0200)]
Fix a likely future bug
Now passing an array of arguments to the `enter` method of modes, instead
of using splats, in order not to destroy the `this` context of the `enter`
methods.
Simon Lydell [Sat, 31 Aug 2013 22:39:41 +0000 (00:39 +0200)]
Fix: Proper modes support
The vim code is now more maintainable, easier to understand and
extensible. This commit makes it easier to implement new modes, such as
the proposed ignore mode.
1. It changed from "agent" sheets to "author" sheets
2. It removed all `!important`
That caused problems with userstyles in userContent.css or Stylish.
Website themes installed by the user often make the hint markers
unreadable, for example.