Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions extensionBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ export async function getAndUpdateModeHandler(

previousActiveEditorUri = activeTextEditor.document.uri;

if (curHandler.focusChanged) {
curHandler.focusChanged = false;

if (previousActiveEditorUri) {
const prevHandler = ModeHandlerMap.get(previousActiveEditorUri);
prevHandler!.focusChanged = true;
}
}

return curHandler;
}

Expand Down Expand Up @@ -161,6 +152,11 @@ export async function activate(context: vscode.ExtensionContext, handleLocal: bo
if (mh.vimState.currentMode === Mode.Insert) {
mh.vimState.historyTracker.currentContentChanges.push(...event.contentChanges);
}

// Let the history tracker know about native undo/redo so it can mirror them onto
// its own undo stack instead of recording them as new forward changes (see #2007).
// Anything else (including our own programmatic edits) carries no reason and is ignored.
mh.vimState.historyTracker.noteNativeUndoRedo(event.reason);
}
});

Expand Down Expand Up @@ -280,11 +276,6 @@ export async function activate(context: vscode.ExtensionContext, handleLocal: bo
return;
}

if (mh.focusChanged) {
mh.focusChanged = false;
return;
}

if (mh.vimState.currentMode === Mode.EasyMotionMode) {
return;
}
Expand Down
Loading
Loading