support t/T command and fix alter mode

This commit is contained in:
Shin'ya Ueoka 2017-09-25 19:49:37 +09:00
parent 2b6aca17b0
commit 6c01283973
3 changed files with 10 additions and 1 deletions

View file

@ -25,11 +25,17 @@ const exec = (operation, tab) => {
case operations.COMMAND_OPEN:
return consoleActions.showCommand('');
case operations.COMMAND_TABS_OPEN:
if (operations.alter) {
if (operation.alter) {
// alter url
return consoleActions.showCommand('open ' + tab.url);
}
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:
return consoleActions.showCommand('buffer ');
default:

View file

@ -4,6 +4,8 @@ const defaultKeymap = {
':': { type: operations.COMMAND_OPEN },
'o': { type: operations.COMMAND_TABS_OPEN, alter: false },
'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 },
'k': { type: operations.SCROLL_LINES, count: -1 },
'j': { type: operations.SCROLL_LINES, count: 1 },

View file

@ -2,6 +2,7 @@ export default {
// Command
COMMAND_OPEN: 'cmd.open',
COMMAND_TABS_OPEN: 'cmd.tabs.open',
COMMAND_TABS_NEW: 'cmd.tabs.new',
COMMAND_BUFFER: 'cmd.buffer',
SCROLL_LINES: 'scroll.lines',