| Age | Commit message (Collapse) | Author | 
|---|
|  |  | 
|  |  | 
|  | This is a workaround for Firefox bug 1408996. | 
|  | This avoids the possibility of leaking keyup events if the keys a
released in a different order from that in which they were pressed.
Also, replace suppressKeyupAfterEscape with this same mechanism.
This fixes a bug (in master/1.59) whereby we leak the keyup event for
`i` when entering insert mode.
TODO:
- `/`, `<Escape>` leaks a keyup event
- `i` leaks a keyup event | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  | 1. Remove the use of mapKeyRegistery from the mode handler.
2. Refactor use of mapKeyRegistery keyboard utils.
This is preparatory to refactoring all of the keyboard handling. | 
|  | Here's the problem...
Many sites define their own keyboard shortcuts, for example Google Play
Music defines `gh` for "go home".
On such sites, it's natural to set up pass keys for `g` and `h`.
But that makes any Vimium key bindings which begin with `g`
inaccessible.
Here, we add a new command `enterNormalMode` which installs a new
normal-mode instance (without any pass keys).  This executes a single
normal-mode command then exits.
Example:
    map \ enterNormalMode
    map | enterNormalMode count=999999
Assuming `g` and `o` are pass keys:
- `gh` or `o` - use the page's binding
- `\gg` - scroll to top
- `2\ggo` - scroll to the top and open the Vomnibar
- `\g<Escape>o` - open the Vomnibar
- `\<Escape>o` - use the page's bindings
- `\\\\\\<Escape>o` - use the page's bindings (new normal-mode instances
  displace previous ones)
This required some changes to the scroller.  Previously, we only ever
had one normal-mode instance, and could arrange statically that the
scroller's key listeners were above normal-mode's key listeners in the
handler stack.  Here, we fix this by adding and removing the scroller's
listeners dynamically, so they're always at the top of the handler
stack. | 
|  |  | 
|  | Here, these map to escape:
    translate x <c-[>
    translate <c-c> <c-[> | 
|  | Under *Custom key mappings* (on the options page), this implements:
    translate x y
Whenever the users types `x` in normal mode or in visual mode, the `x`
is replaced by `y`.
For example:
    map รง l
(which apparently would be helpful on Brazilian keyboards).
Issues:
- Do we want yet another hack like this?  This would be documented only on
  the wiki.
- If we allowed `translate <c-c> <c-[>` (and extended `isEscape()` to
  use the translation), then we'd get the `exitMode` command for free
  (#2253).
- Alternatively, instead of adding a new "command" called `translate`,
  we could overload the existing `map` command.  Since these are
  single-key mappings, there's no ambiguity.  (Although, I guess there's
  a risk some user has junk in their key mappings and would be taken by
  surprise).
Inspired by isssue posted by @vhoyer (#2305).
Fixes #2305. | 
|  |  | 
|  | This only affects key mappings of three keys or longer.
Consider:
    map goa something
    map gob something
Previously, we launched the vomnibar (`o`) on the after `go`, making
these mappings unusable.
This commit fixes that: `go` no longer launches the Vomnibar, but waits
instead to see what the next key is. | 
|  | The code to handle the focus for UI components has been tweaked and
adapted over time, and has become quite complicated (and brittle).  This
reworks it from scratch, and co-locates similar code which does related
things.
Fixes #2099. | 
|  |  | 
|  |  | 
|  | Problems:
  - The meanings of some of the Mode/handlerStack constant names is far
    from obvious.
  - The same thing is named different things in different places.
This changes various constant names such that:
  - the names used in the handler stack and in the modes are the same.
  - ditto vis-a-vis DomUtils.
Also, break out the core of the handler stacks' `bubbleEvent` method
into a switch statements.  This makes it more obvious that the cases are
mutually exclusive. | 
|  |  | 
|  | We've consumed the event here, so we should suppress it. | 
|  | With the help dialog in an iframe, Escape no longer closes it if that
iframe loses the focus.  This fixes that.
See point 2 of #2045.
This is not a perfect solution: it only works if the focus ends up in
the frame from which the help dialog was launched.  However, that is the
the common case and, in particular, it is the case which arises on the
options page -- which is a particularly important use case. | 
|  |  | 
|  | `7gj` should be `1j`.
Also, with:
    map ab SOMETHING
`7aab` should be `1ab`.
Replacement for 7774beb6643c0d905f9caba4345453790af948ad. | 
|  | This reverts commit 7774beb6643c0d905f9caba4345453790af948ad.
Reverting this.  It can be done better (and capture some other incorrect
cases). | 
|  | With #2022, we can now implement normal-mode key-handling tests.
Writing these tests uncovered the bug behind 7774beb6643c0d905f9caba4345453790af948ad. | 
|  | E.g. `7gj` should be `1j`; currently it's `7j`. | 
|  | Normal mode updates the pass keys every time the frame changes (so, also
every time we change tab).  Here, we reset the key state too.  Resetting
the key state makes sense when, for example, the user has changed the
pass keys.  However, it also changes a status quo/master behaviour:
- `g`, change-tab-with-mouse, change-back, `g` -- previously this
  scrolled to top; now it does not. | 
|  | This reinstates the legacy behaviour in the following case:
- `g`
- change tab
- change back to the original tab
- `g`
- ..... which scrolls to top.
It is not obvious that this is the best behaviour, but it is the legacy
behaviour, and it certainly isn't unreasonable. | 
|  | - remove unused "event" parameter
- move methods around to put like with like
- simplify some expressions
- one better method name | 
|  |  | 
|  |  | 
|  |  | 
|  | - simplify pass key condition
- don't keep key-parsing Regexp in memory
- we should reset the key state when the pass keys change | 
|  |  | 
|  |  | 
|  | Previously, the key-handling logic (keyQueue, etc) was and the backend
whereas passKeys were handled in the content scripts - so they were a
long way apart.
Now that they're in the same place, it makes more sense to integrate
passKey handling into the regular key handling, because they depend upon
the same data structures. | 
|  |  | 
|  |  | 
|  |  | 
|  | ... and fix two bugs:
- not suppressing keyup event after keyChar matched in keydown.
- we cannot check the passKeys keyChar in keyup because the key state
  has changed; so we track what the next keyup response should be. | 
|  |  | 
|  | Miscellaneous fixes and tweaks, including:
- Reinstate key logging.
- Fix count handling in line with expected behaviour in #2024.
- Remove `noCount` option; we don't need it.
- Simplify logic in various places.
Fixes #2024. | 
|  |  | 
|  |  | 
|  |  | 
|  | This implements a generic front-end class for key handling (a la normal
mode).  Also:
- supports count prefixes (or not)
- supports multi-key mappings (longer than two)
Also included is a very poor-man's demo.  See the bottom of
mode_key_handler.coffee for some hard-wired key bindings.
IMPORTANT:
   This does not actually work as Vimium.  It's just a demo. |