Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Changelog
* Update Vimari interface to allow users access to their configuration.
* Remove `closeTabReverse` action.
* Normal mode now isolates keybindings from the underlying website, this means that to interact with the underlying website you need to enter insert mode.
* You can enter insert mode by pressing <kbd>i</kbd> and exit the mode by pressing <kbd>esc</kbd>.
* You can enter insert mode by pressing <kbd>i</kbd> and exit the mode by pressing <kbd>esc</kbd>. Activating either mode will display the HUD.
* In insert mode Vimari keybindings are disabled (except for <kbd>esc</kbd> which brings you back to normal mode) allowing you to interact with the underlying website.
* Add `goToFirstInput` action on <kbd>g i</kbd> by default (by [isundaylee](https://github.com/isundaylee)).

Expand Down
13 changes: 12 additions & 1 deletion Vimari Extension/js/injected.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,26 @@ function enterNormalMode() {
// Clear link hints (if any)
deactivateLinkHintsMode();


if (insertMode === false) {
return // We are already in normal mode.
}

// Re-enable if in insert mode
insertMode = false;
HUD.showForDuration('Normal Mode', hudDuration);

Mousetrap.bind('i', enterInsertMode);
}

// Calling it 'insert mode', but it's really just a user-triggered
// off switch for the actions.
function enterInsertMode() {
insertMode = true;
if (insertMode === true) {
return // We are already in insert mode.
}
insertMode = true;
HUD.showForDuration('Insert Mode', hudDuration);
Mousetrap.unbind('i');
}

Expand Down