| Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
InsertMode should not handle key events if document.body is editable
|
|
|
|
For example, the host JavaScript may create an "about:blank" iframe with a
`content-editable` `body`, and then:
* the parent frame may handle `Escape` key events by itself
* but now, Vimium always grabs `Escape` events
* and tries to exit `InsertMode`
* although `document.body` is still current `activeElement`
after `body.blur()`
* as a result, neither the parent can receive and handle wanted keyevents,
nor Vimium will succeed in returing back to NormalMode
|
|
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.
|
|
|
|
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.
|
|
The styles guide says not to use standalone `@`. So this changes the
occurrences I could find (with sed) to `this`. Occurrences within files
with major outstanding PRs are omitted.
|
|
Omitted from #1961.
|
|
This makes the `hideHud` option apply only to insert mode (when entered with `i`).
Fixes #1953.
Fixes #487.
We could rename the option itself and add migration code, but that seems overkill.
An alternative would be to remove this option entirely.
|
|
This allows:
map a passNextKey
map b passNextKey
(Previously, we only picked up the first mapping.)
|
|
(First "fully" functional version.)
|
|
This implements a passNextKey command (initially for normal mode only),
as discussed in #1955.
|
|
|
|
I think we can safely remove this comment now, @mrmr1993. This is
working out very nicely.
|
|
|
|
This fixes issue #853.
|
|
|
|
|
|
|
|
Conflicts:
background_scripts/main.coffee
content_scripts/vimium_frontend.coffee
lib/keyboard_utils.coffee
|
|
|
|
- Minor changes.
- Deactivate modes on inputs from focusInput().
|
|
|
|
If we're in edit mode and the user changes tab, we lose the focus. That
causes edit mode (and any sub mode like visual mode) to exit. When we
return, we're in insert mode!
With this commit, we save the state, and restore it when appropriate.
|
|
|
|
- implement "i", "a".
- fix "w" for edit mode.
- try out "e" for enter edit mode.
- initial implementation "o", "O"
- Suppress backspace and delete.
- Scroll in text areas.
|
|
|
|
I had intended the whole Insert.permanentInstance lark to be gone before
merging #1413. Somehow, this got missed.
It's retained, here, but is only needed for the tests. It gives the
tests a hook into the single insert-mode permanent instance, so they can
test its state.
|
|
We were blurring the active input element whenever we exit insert mode
(my bad). It should only be blurred when we exit insert mode via
Escape.
|
|
|
|
- Mainly comments.
- Rename chooseBadge to updateBadge (for consistency).
- No badge for passkeys; also fix tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- when the selection is contentEditable
- in PostFindMode
Restricted to printable characters.
|
|
|
|
The behaviour in the situations described in #1415 require more thought
and discussion.
|
|
- Set Mode.debug to true to see mode activation/deactivation on the
console.
- Use Mode.log() to see a list of currently-active modes.
- Use handlerStack.debugOn() to enable debugging of the handler stack.
|
|
- Better comments.
- Strip unnecessary handlers for leaving post-find mode.
- Simplify passKeys.
- focusInput now re-bubbles its triggering keydown event.
|