Add actions for increasing/decreasing pane width/height with <C-w> +/-, >/< (#7138)

Fixes #2044
This commit is contained in:
J.R. Maingat 2021-10-07 00:12:31 -04:00 committed by GitHub
parent a7f71a1a53
commit 3a0f14d1f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1776,6 +1776,58 @@ class EvenPaneWidths extends BaseCommand {
}
}
@RegisterAction
class IncreasePaneWidth extends BaseCommand {
modes = [Mode.Normal, Mode.Visual, Mode.VisualLine];
keys = ['<C-w>', '>'];
public override async exec(position: Position, vimState: VimState): Promise<void> {
vimState.postponedCodeViewChanges.push({
command: 'workbench.action.increaseViewWidth',
args: {},
});
}
}
@RegisterAction
class DecreasePaneWidth extends BaseCommand {
modes = [Mode.Normal, Mode.Visual, Mode.VisualLine];
keys = ['<C-w>', '<'];
public override async exec(position: Position, vimState: VimState): Promise<void> {
vimState.postponedCodeViewChanges.push({
command: 'workbench.action.decreaseViewWidth',
args: {},
});
}
}
@RegisterAction
class IncreasePaneHeight extends BaseCommand {
modes = [Mode.Normal, Mode.Visual, Mode.VisualLine];
keys = ['<C-w>', '+'];
public override async exec(position: Position, vimState: VimState): Promise<void> {
vimState.postponedCodeViewChanges.push({
command: 'workbench.action.increaseViewHeight',
args: {},
});
}
}
@RegisterAction
class DecreasePaneHeight extends BaseCommand {
modes = [Mode.Normal, Mode.Visual, Mode.VisualLine];
keys = ['<C-w>', '-'];
public override async exec(position: Position, vimState: VimState): Promise<void> {
vimState.postponedCodeViewChanges.push({
command: 'workbench.action.decreaseViewHeight',
args: {},
});
}
}
@RegisterAction
class CommandTabNext extends BaseCommand {
modes = [Mode.Normal, Mode.Visual, Mode.VisualLine];