diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 6bc70f480d6..c18c41c0893 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -2,6 +2,8 @@ ## [UNRELEASED] +- Editors opened by navigating from the results view are no longer opened in _preview mode_. Now they are opened as a persistent editor. [#630](https://github.com/github/vscode-codeql/pull/630) + ## 1.3.6 - 4 November 2020 - Fix URI encoding for databases that were created with special characters in their paths. [#648](https://github.com/github/vscode-codeql/pull/648) diff --git a/extensions/ql-vscode/src/interface-utils.ts b/extensions/ql-vscode/src/interface-utils.ts index 03efee5ad3c..ff170f01ff7 100644 --- a/extensions/ql-vscode/src/interface-utils.ts +++ b/extensions/ql-vscode/src/interface-utils.ts @@ -167,7 +167,13 @@ export async function showLocation(location?: Location) { const editor = editorsWithDoc.length > 0 ? editorsWithDoc[0] - : await Window.showTextDocument(doc, ViewColumn.One); + : await Window.showTextDocument( + doc, { + // avoid preview mode so editor is sticky and will be added to navigation and search histories. + preview: false, + viewColumn: ViewColumn.One, + }); + const range = location.range; // When highlighting the range, vscode's occurrence-match and bracket-match highlighting will // trigger based on where we place the cursor/selection, and will compete for the user's attention.