mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-11-10 00:59:44 +03:00
Added FeatureRequest #1305. Added Tests for new Feature C in Visual Mode
This commit is contained in:
parent
10a952b41c
commit
a2aa065a58
@ -4990,6 +4990,18 @@ class ActionDeleteLineVisualMode extends BaseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterAction
|
||||
class ActionChangeLineVisualMode extends BaseCommand {
|
||||
modes = [ModeName.Visual, ModeName.VisualLine];
|
||||
keys = ["C"];
|
||||
|
||||
public async exec(position: Position, vimState: VimState): Promise<VimState> {
|
||||
return await new ChangeOperator(this.multicursorIndex).run(vimState,
|
||||
vimState.lastVisualSelectionStart.getLineBegin(),
|
||||
vimState.lastVisualSelectionEnd.getLineEnd());
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterAction
|
||||
class ActionChangeChar extends BaseCommand {
|
||||
modes = [ModeName.Normal];
|
||||
|
@ -683,4 +683,22 @@ suite("Mode Visual", () => {
|
||||
endMode: ModeName.Normal
|
||||
});
|
||||
});
|
||||
|
||||
suite("C will replace all selected lines", () => {
|
||||
newTest({
|
||||
title: "C replaces all selected lines",
|
||||
start: ["first line", "test| line1", "test line2", "second line"],
|
||||
keysPressed: "vjC",
|
||||
end: ["first line", "|", "second line"],
|
||||
endMode: ModeName.Insert
|
||||
});
|
||||
|
||||
newTest({
|
||||
title: "C replaces the current line",
|
||||
start: ["first line", "test| line1", "second line"],
|
||||
keysPressed: "vlllC",
|
||||
end: ["first line", "|", "second line"],
|
||||
endMode: ModeName.Insert
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user