From 0fd472271d9c0cc8f923319418eaf7c559f9bee0 Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Wed, 4 Dec 2019 10:02:23 -0800 Subject: [PATCH] Make all search-result editors have no line numbers And make that configurable --- extensions/search-result/package.json | 5 +++++ src/vs/workbench/contrib/search/browser/searchEditor.ts | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/search-result/package.json b/extensions/search-result/package.json index 0a2af5e0a9d..5e7482b6033 100644 --- a/extensions/search-result/package.json +++ b/extensions/search-result/package.json @@ -19,6 +19,11 @@ "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:search-result ./tsconfig.json" }, "contributes": { + "configurationDefaults": { + "[search-result]": { + "editor.lineNumbers": "off" + } + }, "commands": [ { "command": "searchResult.rerunSearch", diff --git a/src/vs/workbench/contrib/search/browser/searchEditor.ts b/src/vs/workbench/contrib/search/browser/searchEditor.ts index 46792e7b680..b2bc36fbd06 100644 --- a/src/vs/workbench/contrib/search/browser/searchEditor.ts +++ b/src/vs/workbench/contrib/search/browser/searchEditor.ts @@ -291,8 +291,6 @@ export const createEditorFromSearchResult = const editor = await editorService.openEditor(possible); const control = editor?.getControl()!; - control.updateOptions({ lineNumbers: 'off' }); - const model = control.getModel() as ITextModel; model.deltaDecorations([], results.matchRanges.map(range => ({ range, options: { className: 'searchEditorFindMatch', stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges } })));