From dcced2345389370737f6dba3df962133ab232252 Mon Sep 17 00:00:00 2001 From: Nick Belzer Date: Wed, 12 Aug 2020 12:57:08 +0200 Subject: [PATCH 1/2] Show HUD on entering normal or insert mode --- Vimari Extension/js/injected.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Vimari Extension/js/injected.js b/Vimari Extension/js/injected.js index edd6a05..b1283ac 100644 --- a/Vimari Extension/js/injected.js +++ b/Vimari Extension/js/injected.js @@ -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'); } From 600f4bf560f487c46f49ff7f13ea42dc67df78ab Mon Sep 17 00:00:00 2001 From: Nick Belzer Date: Wed, 12 Aug 2020 13:04:50 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e35d0a..934d1ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 i and exit the mode by pressing esc. +* You can enter insert mode by pressing i and exit the mode by pressing esc. Activating either mode will display the HUD. * In insert mode Vimari keybindings are disabled (except for esc which brings you back to normal mode) allowing you to interact with the underlying website. * Add `goToFirstInput` action on g i by default (by [isundaylee](https://github.com/isundaylee)).