Skip to content

Commit 5481515

Browse files
FreedomKnightFreedomKnight
authored andcommitted
fixed tabnew can't open empty tab
1 parent 0ed2a30 commit 5481515

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plugins-client/ext.vim/cli.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ cliCmds[":"].commands = {
208208
tablast: function() {
209209
tabbehaviors.cycleTab("last");
210210
},
211+
tabnew: function(editor, data) {
212+
path = data.argv[1];
213+
if (!path) {
214+
commands.exec("newfile");
215+
} else {
216+
cliCmds[":"].commands.e(editor, data);
217+
}
218+
},
211219
tabclose: "closetab",
212220
tabmove: function(editor, data) {
213221
// todo
@@ -219,7 +227,6 @@ cliCmds[":"].commands = {
219227
cliCmds[":"].commands.write = cliCmds[":"].commands.w;
220228
cliCmds[":"].commands.tabn = cliCmds[":"].commands.tabNext;
221229
cliCmds[":"].commands.tabp = cliCmds[":"].commands.tabPrevious;
222-
cliCmds[":"].commands.tabnew = cliCmds[":"].commands.e;
223230
cliCmds[":"].commands.tabc = cliCmds[":"].commands.tabclose;
224231

225232
cliCmds[":"].commands.set = {

0 commit comments

Comments
 (0)