Skip to content

Commit b77b676

Browse files
committed
Open editor containing query location in non-preview mode
1 parent 2ac7881 commit b77b676

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

extensions/ql-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [UNRELEASED]
44

5+
- Editors opened by navigating from the results view are no longer opened in _preview mode_. Now they are opened as a persistent editor.
6+
57
## 1.3.5 - 27 October 2020
68

79
- Fix a bug where archived source folders for databases were not showing any contents.

extensions/ql-vscode/src/interface-utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ export async function showLocation(location?: Location) {
162162
const editor =
163163
editorsWithDoc.length > 0
164164
? editorsWithDoc[0]
165-
: await Window.showTextDocument(doc, ViewColumn.One);
165+
: await Window.showTextDocument(
166+
doc, {
167+
// avoid preview mode so editor is sticky and will be added to navigation and search histories.
168+
preview: false,
169+
viewColumn: ViewColumn.One,
170+
});
171+
166172
const range = location.range;
167173
// When highlighting the range, vscode's occurrence-match and bracket-match highlighting will
168174
// trigger based on where we place the cursor/selection, and will compete for the user's attention.

0 commit comments

Comments
 (0)