mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-08-17 00:00:26 +03:00
gJ in visual mode
This commit is contained in:
parent
b2f0cb8d50
commit
0e82bd195a
@ -295,7 +295,7 @@ Status | Command | Description
|
||||
:white_check_mark: | :1234: J | join N-1 lines (delete EOLs)
|
||||
:white_check_mark: | {visual}J | join the highlighted lines
|
||||
:white_check_mark: | :1234: gJ | like "J", but without inserting spaces
|
||||
| {visual}gJ | like "{visual}J", but without inserting spaces
|
||||
:white_check_mark:| {visual}gJ | like "{visual}J", but without inserting spaces
|
||||
| :[range]d [x] | delete [range] lines [into register x]
|
||||
|
||||
## Copying and moving text
|
||||
|
@ -3017,6 +3017,32 @@ class ActionJoinNoWhitespace extends BaseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterAction
|
||||
class ActionJoinNoWhitespaceVisualMode extends BaseCommand {
|
||||
modes = [ModeName.Visual];
|
||||
keys = ["g", "J"];
|
||||
|
||||
public async exec(position: Position, vimState: VimState): Promise<VimState> {
|
||||
let actionJoin = new ActionJoinNoWhitespace();
|
||||
let start = Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start);
|
||||
let end = Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.end);
|
||||
|
||||
if (start.line === end.line) {
|
||||
return vimState;
|
||||
}
|
||||
|
||||
if (start.isAfter(end)) {
|
||||
[start, end] = [end, start];
|
||||
}
|
||||
|
||||
for (let i = start.line; i < end.line; i++) {
|
||||
vimState = await actionJoin.exec(start, vimState);
|
||||
}
|
||||
|
||||
return vimState;
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterAction
|
||||
class ActionReplaceCharacter extends BaseCommand {
|
||||
modes = [ModeName.Normal];
|
||||
|
Loading…
Reference in New Issue
Block a user