From a106823e9249769e911ed2ad6e96f6ca328842c7 Mon Sep 17 00:00:00 2001 From: hadashiA Date: Sun, 28 Jan 2018 14:31:58 +0900 Subject: [PATCH] add settings.updowncompletion --- README.md | 1 + background_scripts/options.js | 1 + content_scripts/keys.js | 9 +++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d6ccf253..c3e3b3e8 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ These extensions do a wonderful job of adding Vim-like keybindings to Google Chr | dimhintcharacters | boolean | dim letter matches in hint characters rather than remove them from the hint | true | | defaultnewtabpage | boolean | use the default chrome://newtab page instead of a blank page | false | | cncpcompletion | boolean | use `` and `` to cycle through completion results (requires you to set the nextCompletionResult keybinding in the chrome://extensions page (bottom right) | false | +| updowncompletion | boolean | use `` and `` to cycle through completion results | false | | smartcase | boolean | case-insensitive find mode searches except when input contains a capital letter | true | | incsearch | boolean | begin auto-highlighting find mode matches when input length is greater thant two characters | true | | typelinkhints | boolean | (numerichints required) type text in the link to narrow down numeric hints | false | diff --git a/background_scripts/options.js b/background_scripts/options.js index 8f139310..b8c0bbf4 100644 --- a/background_scripts/options.js +++ b/background_scripts/options.js @@ -19,6 +19,7 @@ var defaultSettings = { ignorecase: true, numerichints: false, cncpcompletion: false, + updowncompletion: false, smartcase: true, incsearch: true, autohidecursor: false, diff --git a/content_scripts/keys.js b/content_scripts/keys.js index e5de8e01..b16aa917 100644 --- a/content_scripts/keys.js +++ b/content_scripts/keys.js @@ -762,8 +762,13 @@ var KeyHandler = { return; case '': // Command history navigation/search case '': - event.preventDefault(); - Command.history.cycle(Command.type, (key === '')); + if (Command.type === 'action' && settings.updowncompletion) { + event.preventDefault(); + Mappings.actions[ (key === '' ? 'previous' : 'next') + 'CompletionResult' ](); + } else { + event.preventDefault(); + Command.history.cycle(Command.type, (key === '')); + } break; case '': case '':