Skip to content

Commit

Permalink
fix undo points when moving around in insert with mouse or arrow keys
Browse files Browse the repository at this point in the history
  • Loading branch information
xconverge committed Mar 20, 2017
1 parent 00b293e commit 25e444b
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,23 +929,16 @@ export class ModeHandler implements vscode.Disposable {

// If arrow keys or mouse was used prior to entering characters while in insert mode, create an undo point
// this needs to happen before any changes are made

/*
TODO
// If arrow keys or mouse were in insert mode, create an undo point.
// This needs to happen before any changes are made
let prevPos = vimState.historyTracker.getLastHistoryEndPosition();
if (prevPos !== undefined && !vimState.isRunningDotCommand) {
if (vimState.cursorPositionJustBeforeAnythingHappened.line !== prevPos.line ||
vimState.cursorPositionJustBeforeAnythingHappened.character !== prevPos.character) {
vimState.globalState.previousFullAction = recordedState;
vimState.historyTracker.finishCurrentStep();
if (!vimState.isMultiCursor) {
let prevPos = vimState.historyTracker.getLastHistoryEndPosition();
if (prevPos !== undefined && !vimState.isRunningDotCommand) {
if (vimState.cursorPositionJustBeforeAnythingHappened[0].line !== prevPos[0].line ||
vimState.cursorPositionJustBeforeAnythingHappened[0].character !== prevPos[0].character) {
vimState.globalState.previousFullAction = recordedState;
vimState.historyTracker.finishCurrentStep();
}
}
}
*/

if (action instanceof BaseMovement) {
({ vimState, recordedState } = await this.executeMovement(vimState, action));
Expand Down

0 comments on commit 25e444b

Please sign in to comment.