Merge branch 'some-fix'
This commit is contained in:
commit
c2a5a41cb6
4 changed files with 13 additions and 1 deletions
|
@ -25,11 +25,17 @@ const exec = (operation, tab) => {
|
||||||
case operations.COMMAND_OPEN:
|
case operations.COMMAND_OPEN:
|
||||||
return consoleActions.showCommand('');
|
return consoleActions.showCommand('');
|
||||||
case operations.COMMAND_TABS_OPEN:
|
case operations.COMMAND_TABS_OPEN:
|
||||||
if (operations.alter) {
|
if (operation.alter) {
|
||||||
// alter url
|
// alter url
|
||||||
return consoleActions.showCommand('open ' + tab.url);
|
return consoleActions.showCommand('open ' + tab.url);
|
||||||
}
|
}
|
||||||
return consoleActions.showCommand('open ');
|
return consoleActions.showCommand('open ');
|
||||||
|
case operations.COMMAND_TABS_NEW:
|
||||||
|
if (operation.alter) {
|
||||||
|
// alter url
|
||||||
|
return consoleActions.showCommand('tabopen ' + tab.url);
|
||||||
|
}
|
||||||
|
return consoleActions.showCommand('tabopen ');
|
||||||
case operations.COMMAND_BUFFER:
|
case operations.COMMAND_BUFFER:
|
||||||
return consoleActions.showCommand('buffer ');
|
return consoleActions.showCommand('buffer ');
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -4,6 +4,8 @@ const defaultKeymap = {
|
||||||
':': { type: operations.COMMAND_OPEN },
|
':': { type: operations.COMMAND_OPEN },
|
||||||
'o': { type: operations.COMMAND_TABS_OPEN, alter: false },
|
'o': { type: operations.COMMAND_TABS_OPEN, alter: false },
|
||||||
'O': { type: operations.COMMAND_TABS_OPEN, alter: true },
|
'O': { type: operations.COMMAND_TABS_OPEN, alter: true },
|
||||||
|
't': { type: operations.COMMAND_TABS_NEW, alter: false },
|
||||||
|
'T': { type: operations.COMMAND_TABS_NEW, alter: true },
|
||||||
'b': { type: operations.COMMAND_BUFFER },
|
'b': { type: operations.COMMAND_BUFFER },
|
||||||
'k': { type: operations.SCROLL_LINES, count: -1 },
|
'k': { type: operations.SCROLL_LINES, count: -1 },
|
||||||
'j': { type: operations.SCROLL_LINES, count: 1 },
|
'j': { type: operations.SCROLL_LINES, count: 1 },
|
||||||
|
|
|
@ -63,6 +63,9 @@ window.addEventListener('keypress', (e) => {
|
||||||
if (e.target instanceof HTMLInputElement ||
|
if (e.target instanceof HTMLInputElement ||
|
||||||
e.target instanceof HTMLTextAreaElement ||
|
e.target instanceof HTMLTextAreaElement ||
|
||||||
e.target instanceof HTMLSelectElement) {
|
e.target instanceof HTMLSelectElement) {
|
||||||
|
if (e.key === 'Escape' && e.target.blur) {
|
||||||
|
e.target.blur();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
browser.runtime.sendMessage({
|
browser.runtime.sendMessage({
|
||||||
|
|
|
@ -2,6 +2,7 @@ export default {
|
||||||
// Command
|
// Command
|
||||||
COMMAND_OPEN: 'cmd.open',
|
COMMAND_OPEN: 'cmd.open',
|
||||||
COMMAND_TABS_OPEN: 'cmd.tabs.open',
|
COMMAND_TABS_OPEN: 'cmd.tabs.open',
|
||||||
|
COMMAND_TABS_NEW: 'cmd.tabs.new',
|
||||||
COMMAND_BUFFER: 'cmd.buffer',
|
COMMAND_BUFFER: 'cmd.buffer',
|
||||||
|
|
||||||
SCROLL_LINES: 'scroll.lines',
|
SCROLL_LINES: 'scroll.lines',
|
||||||
|
|
Reference in a new issue