Skip to content

Commit

Permalink
Make <C-v> in insert mode overwrite selected text
Browse files Browse the repository at this point in the history
Fixes #4589
  • Loading branch information
J-Fields committed Feb 26, 2020
1 parent 318e411 commit 38b49c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/actions/commands/insert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,11 @@ class CommandCtrlVInInsertMode extends BaseCommand {
public async exec(position: Position, vimState: VimState): Promise<VimState> {
const textFromClipboard = await Clipboard.Paste();

vimState.recordedState.transformations.push({
type: 'deleteRange',
range: new Range(vimState.cursorStartPosition, vimState.cursorStopPosition),
});

if (vimState.isMultiCursor) {
vimState.recordedState.transformations.push({
type: 'insertText',
Expand Down

0 comments on commit 38b49c5

Please sign in to comment.