Skip to content
This repository was archived by the owner on Apr 15, 2021. It is now read-only.
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
9 changes: 9 additions & 0 deletions content_scripts/hints.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ Hints.dispatchAction = function(link, shift) {
noconvert: true
});
break;
case 'multiwindow':
RUNTIME('openLinkWindow', {
focused: false,
url: link.href,
noconvert: true
});
break;
case 'script':
eval(settings.FUNCTIONS[this.scriptFunction])(link);
break;
Expand Down Expand Up @@ -674,6 +681,7 @@ Hints.genHints = function(M) {
return codes0.concat(codes1);
};

///NOTE: "type" is a string, "multi" is a boolean. "multi" seems to go unused; multi, multiyank, and multiimage don't use the multi param. The dispatchAction function only checks it when trying to make new tabs that have "tabbed" in the name of the type.
Hints.create = function(type, multi) {
var self = this;
window.setTimeout(function() {
Expand Down Expand Up @@ -742,6 +750,7 @@ Hints.create = function(type, multi) {
tabbed: '(tabbed)',
tabbedActive: '(tabbed)',
window: '(window)',
multiwindow: '(multi-window)',
edit: '(edit)',
hover: '(hover)',
unhover: '(unhover)',
Expand Down
6 changes: 6 additions & 0 deletions content_scripts/mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@ Mappings.actions = {
createActiveTabbedHint: function() { Hints.create('tabbedActive'); },
createMultiHint: function() { Hints.create('multi'); },
createHintWindow: function() { Hints.create('window'); },
createHintMultiWindow: function() {
window.setTimeout(function() {
Hints.create('multiwindow');
//PORT('bringCurrentWindowToFront'); //does not function; I think port listeners are destroyed by this point.
}, 0);
},
createEditHint: function() { Hints.create('edit'); },
createHoverHint: function() { Hints.create('hover'); },
createUnhoverHint: function() { Hints.create('unhover'); },
Expand Down
6 changes: 6 additions & 0 deletions content_scripts/messenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ port.onMessage.addListener(function(response) {
Mappings.lastCommand = JSON.parse(request.data);
}
break;
/*Designed to be added to the "multiwindow" hint command. Don't want to heavily modify this file before the code is refactored
case 'bringCurrentWindowToFront':
chrome.windows.getCurrent((function (win){
chrome.windows.update(win.id, {focused: true});
}));
break;*/
}
});

Expand Down
7 changes: 6 additions & 1 deletion pages/mappings.html
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,11 @@ <h1>Keybindings</h1>
<td style="text-align:left">createHintWindow</td>
</tr>
<tr>
<td>unmapped</td>
<td style="text-align:left">open multiple links in new windows</td>
<td style="text-align:left">createHintMultiWindow</td>
</tr>
<tr>
<td><code>A</code></td>
<td style="text-align:left">repeat last hint command</td>
<td style="text-align:left">openLastHint</td>
Expand Down Expand Up @@ -1441,4 +1446,4 @@ <h1>History</h1>
<a href="https://github.com/1995eaton/chromium-vim">cVim</a>.</p>
<p>To understand why this fork was created, please see the discussion on the
<a href="https://github.com/1995eaton/chromium-vim/issues/723">relevant GitHub Issue</a>.</p>
</html>
</html>