From 0727ad7cbcae0e725041b4efeeda7510abc8bd2d Mon Sep 17 00:00:00 2001 From: Michael Lively Date: Thu, 29 Feb 2024 16:28:00 -0800 Subject: [PATCH] Candidate: Fix stuck highlighting when `"editor.occurrencesHighlight": "off"` (#206559) occurrence off fix --- .../contrib/wordHighlighter/browser/wordHighlighter.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts index 8b9790bce2177..cae4374290252 100644 --- a/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts @@ -310,6 +310,11 @@ class WordHighlighter { this._onPositionChanged(e); })); this.toUnhook.add(editor.onDidFocusEditorText((e) => { + if (this.occurrencesHighlight === 'off') { + // Early exit if nothing needs to be done + return; + } + if (!this.workerRequest) { this._run(); }