Merge pull request #2812 from xconverge/fix-gt

Make gt work correctly like gT
This commit is contained in:
Sean Kelly 2018-07-06 08:17:38 -07:00 committed by GitHub
commit bd39e6b224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -2981,7 +2981,7 @@ class CommandTabNext extends BaseTabCommand {
public async exec(position: Position, vimState: VimState): Promise<VimState> {
new TabCommand({
tab: Tab.Next,
count: vimState.recordedState.count,
count: 1,
}).execute();
return vimState;

View File

@ -46,15 +46,14 @@ export class TabCommand extends node.CommandBase {
async execute(): Promise<void> {
switch (this._arguments.tab) {
case Tab.Next:
if (this._arguments.count /** not undefined or 0 */) {
await vscode.commands.executeCommand('workbench.action.openEditorAtIndex1');
await this.executeCommandWithCount(
this._arguments.count! - 1,
'workbench.action.nextEditorInGroup'
);
} else {
await vscode.commands.executeCommand('workbench.action.nextEditorInGroup');
if (this._arguments.count !== undefined && this._arguments.count <= 0) {
break;
}
await this.executeCommandWithCount(
this._arguments.count || 1,
'workbench.action.nextEditorInGroup'
);
break;
case Tab.Previous:
if (this._arguments.count !== undefined && this._arguments.count <= 0) {