mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-11 12:25:59 +03:00
Tab Close and Tab Only
This commit is contained in:
parent
061f86ea61
commit
17edb76444
@ -388,6 +388,8 @@ Status | Command | Description
|
||||
---|--------|------------------------------
|
||||
:warning: | :1234: :tabe[dit] | Open a new tab page with an empty window, after the current tab page
|
||||
:warning: | :1234: :tabnew | Open a new tab page with an empty window, after the current tab page
|
||||
:warning: | :tabc[lose][!] :1234: | Close current tab page.
|
||||
:warning: | :tabo[nly][!] | Close all other tab pages.
|
||||
:white_check_mark: | :tabn[ext] :1234: | Go to tab page {count}. The first tab page has number one.
|
||||
:white_check_mark: | :tabp[revious] :1234: | Go to the previous tab page. Wraps around from the first one to the last one.
|
||||
:white_check_mark: | :tabfir[st] | Go to the first tab page.
|
||||
|
@ -8,7 +8,9 @@ export enum Tab {
|
||||
Previous,
|
||||
First,
|
||||
Last,
|
||||
New
|
||||
New,
|
||||
Close,
|
||||
Only
|
||||
}
|
||||
|
||||
export interface ITabCommandArguments extends node.ICommandArgs {
|
||||
@ -61,6 +63,12 @@ export class TabCommand extends node.CommandBase {
|
||||
case Tab.New:
|
||||
this.executeCommandWithCount(this._arguments.count, "workbench.action.files.newUntitledFile");
|
||||
break;
|
||||
case Tab.Close:
|
||||
this.executeCommandWithCount(this._arguments.count, "workbench.action.closeActiveEditor");
|
||||
break;
|
||||
case Tab.Only:
|
||||
this.executeCommandWithCount(this._arguments.count, "workbench.action.closeOtherEditors");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -14,13 +14,23 @@ export const commandParsers = {
|
||||
|
||||
tabn: tabCmd.parseTabNCommandArgs,
|
||||
tabnext: tabCmd.parseTabNCommandArgs,
|
||||
|
||||
tabp: tabCmd.parseTabPCommandArgs,
|
||||
tabprevious: tabCmd.parseTabPCommandArgs,
|
||||
|
||||
tabfirst: tabCmd.parseTabFirstCommandArgs,
|
||||
tabfir: tabCmd.parseTabFirstCommandArgs,
|
||||
|
||||
tablast: tabCmd.parseTabLastCommandArgs,
|
||||
tabl: tabCmd.parseTabLastCommandArgs,
|
||||
|
||||
tabe: tabCmd.parseTabNewCommandArgs,
|
||||
tabedit: tabCmd.parseTabNewCommandArgs,
|
||||
tabnew: tabCmd.parseTabNewCommandArgs
|
||||
tabnew: tabCmd.parseTabNewCommandArgs,
|
||||
|
||||
tabclose: tabCmd.parseTabCloseCommandArgs,
|
||||
tabc: tabCmd.parseTabCloseCommandArgs,
|
||||
|
||||
tabo: tabCmd.parseTabOnlyCommandArgs,
|
||||
tabonly: tabCmd.parseTabOnlyCommandArgs
|
||||
};
|
||||
|
@ -63,4 +63,16 @@ export function parseTabNewCommandArgs(args: string) : node.TabCommand {
|
||||
return new node.TabCommand({
|
||||
tab: node.Tab.New
|
||||
});
|
||||
}
|
||||
|
||||
export function parseTabCloseCommandArgs(args: string) : node.TabCommand {
|
||||
return new node.TabCommand({
|
||||
tab: node.Tab.Close
|
||||
});
|
||||
}
|
||||
|
||||
export function parseTabOnlyCommandArgs(args: string) : node.TabCommand {
|
||||
return new node.TabCommand({
|
||||
tab: node.Tab.Only
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user