mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-21 17:19:45 +03:00
Totally fix gd.
This commit is contained in:
parent
31044f0904
commit
c78e87b3ac
13
extension.ts
13
extension.ts
@ -73,11 +73,19 @@ export async function getAndUpdateModeHandler(): Promise<ModeHandler> {
|
||||
const oldHandler = modeHandlerToEditorIdentity[previousActiveEditorId.toString()];
|
||||
const activeEditorId = new EditorIdentity(vscode.window.activeTextEditor);
|
||||
|
||||
if (!modeHandlerToEditorIdentity[activeEditorId.toString()]) {
|
||||
const oldModeHandler = modeHandlerToEditorIdentity[activeEditorId.toString()];
|
||||
|
||||
if (!oldModeHandler ||
|
||||
oldModeHandler.editor !== vscode.window.activeTextEditor) {
|
||||
|
||||
const newModeHandler = new ModeHandler(activeEditorId);
|
||||
|
||||
modeHandlerToEditorIdentity[activeEditorId.toString()] = newModeHandler;
|
||||
extensionContext.subscriptions.push(newModeHandler);
|
||||
|
||||
if (oldModeHandler) {
|
||||
oldModeHandler.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
const handler = modeHandlerToEditorIdentity[activeEditorId.toString()];
|
||||
@ -88,9 +96,6 @@ export async function getAndUpdateModeHandler(): Promise<ModeHandler> {
|
||||
if (!previousActiveEditorId.isEqual(activeEditorId)) {
|
||||
// We have opened two editors, working on the same file.
|
||||
previousActiveEditorId = activeEditorId;
|
||||
|
||||
handler.vimState.cursorPosition = Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.end);
|
||||
handler.vimState.cursorStartPosition = Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start);
|
||||
}
|
||||
} else {
|
||||
previousActiveEditorId = activeEditorId;
|
||||
|
Loading…
Reference in New Issue
Block a user