Skip to content
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ These extensions do a wonderful job of adding Vim-like keybindings to Google Chr
| sortlinkhints | boolean | Sort link hint lettering by the link's distance from the top-left corner of the page | false |
| localconfig | boolean | Read the cVimrc config from `configpath` (when this is set, you connot save from cVim's options page | false |
| completeonopen | boolean | Automatically show a list of command completions when the command bar is opened | false |
| manualcompletion | boolean | Wait for Tab key instead of automatically showing command completions (e.g. with 'open') | false |
| configpath | string | Read the cVimrc from this local file when configpath is set | "" |
| changelog | boolean | Auto open the changelog when cVim is updated | true |
| completionengines | array of strings | use only the specified search engines | ["google", "duckduckgo", "wikipedia", "amazon"] |
Expand Down
1 change: 1 addition & 0 deletions background_scripts/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var defaultSettings = {
localconfig: false,
completeonopen: false,
debugcss: false, // Always use default COMMANDBARCSS
manualcompletion: false,
scrollduration: 500,
zoomfactor: 0.10,
configpath: '',
Expand Down
10 changes: 10 additions & 0 deletions content_scripts/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Command.dataElements = [];
Command.matches = [];
Command.customCommands = {};
Command.lastInputValue = '';
Command.completionsNeedUpdate = false;

Command.setupFrameElements = function() {
this.bar = document.createElement('div');
Expand Down Expand Up @@ -181,8 +182,17 @@ Command.completionOrder = {
};

Command.updateCompletions = function(useStyles) {
if (settings.manualcompletion) {
this.completionsNeedUpdate = true;
} else {
this.executeCompletionUpdate(useStyles);
}
};

Command.executeCompletionUpdate = function(useStyles) {
if (!window.isCommandFrame)
return;
this.completionsNeedUpdate = false;
this.completionResults = [];
this.dataElements = [];
this.data.innerHTML = '';
Expand Down
8 changes: 6 additions & 2 deletions content_scripts/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,12 @@ var KeyHandler = {
case '<S-Tab>':
if (Command.type === 'action') {
event.preventDefault();
Mappings.actions[ (key === '<Tab>' ? 'next' : 'previous') +
'CompletionResult' ]();
if (Command.completionsNeedUpdate) {
Command.executeCompletionUpdate(true);
} else {
Mappings.actions[ (key === '<Tab>' ? 'next' : 'previous') +
'CompletionResult' ]();
}
}
break;
case '<C-p>':
Expand Down
8 changes: 7 additions & 1 deletion pages/mappings.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ <h3>cVimrc</h3>
<td style="text-align:right">false</td>
</tr>
<tr>
<td>manualcompletion</td>
<td>boolean</td>
<td>Wait for Tab key instead of automatically showing command completions (e.g. with 'open')</td>
<td style="text-align:right">false</td>
</tr>
<tr>
<td>configpath</td>
<td>string</td>
<td>Read the cVimrc from this local file when configpath is set</td>
Expand Down Expand Up @@ -1430,4 +1436,4 @@ <h1>Contributing</h1>
<li>Click on &quot;Load Unpacked Extension…&quot;</li>
<li>Select the cVim directory.</li>
</ol>
</html>
</html>