mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-20 00:27:41 +03:00
Add comment operator 'gb'.
This commit make it possbile to use 'gb' to toggle line comments.
This commit is contained in:
parent
fe9a6cc875
commit
bd780205a2
@ -7050,3 +7050,19 @@ class CommandSurroundAddToReplacement extends BaseCommand {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterAction
|
||||
export class CommentOperator extends BaseOperator {
|
||||
public keys = ["g", "b"];
|
||||
public modes = [ModeName.Normal, ModeName.Visual, ModeName.VisualLine];
|
||||
|
||||
public async run(vimState: VimState, start: Position, end: Position): Promise<VimState> {
|
||||
vimState.editor.selection = new vscode.Selection(start.getLineBegin(), end.getLineEnd());
|
||||
await vscode.commands.executeCommand("editor.action.commentLine");
|
||||
|
||||
vimState.cursorPosition = new Position(start.line, 0);
|
||||
vimState.currentMode = ModeName.Normal;
|
||||
|
||||
return vimState;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user