Skip to content

Commit

Permalink
Fixes #1715
Browse files Browse the repository at this point in the history
  • Loading branch information
Chillee committed May 19, 2017
1 parent 7b3250f commit 4e9ead3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/actions/commands/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,10 @@ export class PutCommand extends BaseCommand {
runsOnceForEachCountPrefix = true;
canBeRepeatedWithDot = true;

constructor(multicursorIndex?: number) {
super();
this.multicursorIndex = multicursorIndex;
}
public static async GetText(vimState: VimState, multicursorIndex: number | undefined = undefined): Promise<string> {
const register = await Register.get(vimState);

Expand Down Expand Up @@ -1350,11 +1354,12 @@ export class PutCommandVisual extends BaseCommand {
// The reason we need to handle Delete and Yank separately is because of
// linewise mode. If we're in visualLine mode, then we want to copy
// linewise but not necessarily delete linewise.
let result = await new PutCommand().exec(start, vimState, true);
let result = await new PutCommand(this.multicursorIndex).exec(start, vimState, true);
result.currentRegisterMode = isLineWise ? RegisterMode.LineWise : RegisterMode.CharacterWise;
result = await new operator.YankOperator(this.multicursorIndex).run(result, start, end);
result.currentRegisterMode = RegisterMode.CharacterWise;
result = await new operator.DeleteOperator(this.multicursorIndex).run(result, start, end.getLeftIfEOL(), false);
result.currentRegisterMode = RegisterMode.FigureItOutFromCurrentMode;
return result;

}
Expand Down
4 changes: 0 additions & 4 deletions src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1020,10 +1020,6 @@ export class ModeHandler implements vscode.Disposable {

ranRepeatableAction = (ranRepeatableAction && vimState.currentMode === ModeName.Normal) || this.createUndoPointForBrackets(vimState);

// Don't record an undo point for every action of a macro, only at the very end

ranAction = ranAction && vimState.currentMode === ModeName.Normal;

// Record down previous action and flush temporary state
if (ranRepeatableAction) {
vimState.globalState.previousFullAction = vimState.recordedState;
Expand Down

0 comments on commit 4e9ead3

Please sign in to comment.