Skip to content

Commit fa5461b

Browse files
committed
Fix jumps going to right file, but wrong line
1 parent d1b078a commit fa5461b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/jumps/jumpTracker.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ export class JumpTracker {
114114
if (jump.document) {
115115
try {
116116
// Open jump file from stored editor
117-
await vscode.window.showTextDocument(jump.document);
117+
await vscode.window.showTextDocument(jump.document, {
118+
selection: new vscode.Range(jump.position, jump.position),
119+
});
118120
} catch (e: unknown) {
119121
// This can happen when the document we'd like to jump to is weird (like a search editor) or has been deleted
120122
throw VimError.fromCode(ErrorCode.FileNoLongerAvailable);
@@ -136,7 +138,9 @@ export class JumpTracker {
136138
)[0];
137139

138140
if (editor) {
139-
await vscode.window.showTextDocument(editor.document, jump.position.character, false);
141+
await vscode.window.showTextDocument(editor.document, {
142+
selection: new vscode.Range(jump.position, jump.position),
143+
});
140144
}
141145
}
142146
}

0 commit comments

Comments
 (0)