Change:
! Version: 1.85.0-insider (user setup) Commit: Date: 2023-12-01T19:00:37.339Z Electron: 25.9.6 ElectronBuildId: Chromium: 114.0.5735.289 18.15.0 V8: 11.4.183.29-electron.0 OS: WindowsNT x64 10.0.
I think that is expected, see This should behave the same for when multiple editor groups are opened in the same window.
The issue is that highlighted words remain until a new word is focused. In the main window, the highlights disappear when the word loses focus.
not for me in this case: ! Do you have a case where highlights remove to reproduce?
In the main window, If you click on a word and then on a blank line, the highlight disappears: !
my assumption here is that the other editor is over a word that then is highlighted in the floating editor. There is probably a heuristic to decide which highlight to apply. Can you double check my theory?
it doesn't matter if it's on the same word or not but I found out this only happens if the same editor is opened on the main window or in other windows (in this case the first floating editor highlights disappear after losing focus). Highlights disappear after losing focus in: Main window Single floating editor (Not opened in main window) Only the first floating editor when there are multiple (Not opened in main window)
I can reproduce but this is not a floating window issue. It reproduces even when you just have 2 editor groups opened next to each other: !
tl;dr: Setting to "off" fixes it. I'm seeing what I think is the same bug, after upgrading to 1.85.1 (first upgrade in a number of months, so I've jumped a few versions). While writing this I think there are two distinct problems. The first is when a single file is open: -click a word. It highlights that word, and in a different grey highlights the same word in rest of document. esc: nothing happens. I now need to click a blank line to get the highlights to go away. (I'm sure esc used to get rid of it before??) The second is much more annoying, but only seems to happen when I have same file open twice, after using Split Editor Right. -click a word. It highlights that word, and (in a different shade of grey) highlights the same word in rest of window. In the other window it highlights some (but not all!) of the same word. doesn't get rid of it. Clicking a blank line does not get rid of it. All the grey highlights are there forever. the other window: still the highlights are there. I can now double-click a different word and see it highlight throughout document, click blank line gets rid of that one, but still my first set of highlights survive! only way to get rid of them is to close the editor and open it again. OR, reduce to just one window open, double-click it again, and then click a blank line. Playing around, I've noticed it does not matter which window I do the double-click in, it is the window on the right where the unwanted highlights survive. Regarding mentioned in the 1.84 release notes, searching for that in settings doesn't find anything. But I do have as mentioned in It is currently set to "singleFile" If I set it to "off", everything works as it used to. Double-click still highlights within the open file (only), and esc now cancels it again :-) BTW, testing the 3rd option, "multiFile", it appears to behave exactly as "singleFile" in every respect I described above. Anyway, switching to "off" gives me exactly the behaviour I want, so I'm happy.
Thanks for the detailed writeup! The editor highlights have been reworked to start bringing in support for semantic highlighting between multiple documents. This was primarily tested between multiple different documents and there are some bugs arising that have to do with split view of the same file. Will be addressing in the near future.
Friendly ping! Looks like this issue requires some further steps to be verified. Please provide us with the steps necessary to verify this issue.
Steps for verification: Open a typescript file in split view, with content as follows: In the left panel, click the symbol. In the right panel, click the same symbol. In the right panel, click anywhere else that isn't a symbol. choose any whitespace, etc in Stable: The highlights should disappear from the left panel, but persist in the right, even as you click around the right panel. Fixed on insiders: You should not be able to end up in a state with persistent highlights when your cursor is not on a symbol.

Discussion:
this._onPositionChanged(e); })); <ins> this.toUnhook.add(editor.onDidFocusEditorText((e) => { if (!this.workerRequest) { this._run(); } })); </ins> this.toUnhook.add(editor.onDidChangeModelContent((e) => { this._stopAll(); }));

if (editorHighlighterContrib.wordHighlighter.decorations.length > 0) { editorHighlighterContrib.wordHighlighter.decorations.clear(); <ins> editorHighlighterContrib.wordHighlighter.workerRequest = null; </ins> editorHighlighterContrib.wordHighlighter._hasWordHighlights.set(false); } }

if (this.editor.hasTextFocus()) { if (this.editor.getModel()?.uri.scheme !== Schemas.vscodeNotebookCell && WordHighlighter.query?.modelInfo?.model.uri.scheme !== Schemas.vscodeNotebookCell) { // clear query if focused non-nb editor WordHighlighter.query = null; <del> this._run(); </del> <ins> this._run(); // TODO: @Yoyokrazy -- investigate why we need a full rerun here. likely addressed a case/patch in the first iteration of this feature </ins> } else { // remove modelInfo to account for nb cell being disposed if (WordHighlighter.query?.modelInfo) { WordHighlighter.query.modelInfo = null;

private _run(): void { let workerRequestIsValid; <del> if (!this.editor.hasTextFocus()) { // no focus (new nb cell, etc) if (WordHighlighter.query === null) { // no previous query, nothing to highlight </del> <ins> const hasTextFocus = this.editor.hasTextFocus(); if (!hasTextFocus) { // new nb cell scrolled in, didChangeModel fires if (!WordHighlighter.query) { // no previous query, nothing to highlight off of </ins> return; } <del> } else { </del> <ins> } else { // has text focus </ins> const editorSelection = this.editor.getSelection(); // ignore multiline selection if (!editorSelection || editorSelection.startLineNumber !== editorSelection.endLineNumber) { <ins> WordHighlighter.query = null; </ins> this._stopAll(); return; }

const otherModelsToHighlight = this.getOtherModelsToHighlight(this.editor.getModel()); <del> // 2 cases where we want to send the word // a) there is no stored query model, but there is a word. This signals the editor that drove the highlight is disposed (cell out of viewport, etc) // b) the queried model is not the current model. This signals that the editor that drove the highlight is still in the viewport, but we are highlighting a different cell // otherwise, we send null in place of the word, and the model and selection are used to compute the word // TODO: @Yoyokrazy -- investigate this logic for sendWord const sendWord = (!WordHighlighter.query.modelInfo && WordHighlighter.query.word) || (WordHighlighter.query.modelInfo?.model.uri !== this.model.uri) ? true : false; if (!WordHighlighter.query.modelInfo || (WordHighlighter.query.modelInfo.model.uri !== this.model.uri)) { // use this.model this.workerRequest = this.computeWithModel(this.model, this.editor.getSelection(), sendWord ? WordHighlighter.query.word : null, otherModelsToHighlight); } else { // use stored query model + selection this.workerRequest = this.computeWithModel(WordHighlighter.query.modelInfo.model, WordHighlighter.query.modelInfo.selection, WordHighlighter.query.word, otherModelsToHighlight); </del> <ins> // when reaching here, there are two possible states. // 		1) we have text focus, and a valid query was updated. // 		2) we do not have text focus, and a valid query is cached. // the query will ALWAYS have the correct data for the current highlight request, so it can always be passed to the workerRequest safely if (!WordHighlighter.query.modelInfo || WordHighlighter.query.modelInfo.model.isDisposed()) { return; </ins> } <ins> this.workerRequest = this.computeWithModel(WordHighlighter.query.modelInfo.model, WordHighlighter.query.modelInfo.selection, WordHighlighter.query.word, otherModelsToHighlight); </ins> this.workerRequest?.result.then(data => { if (myRequestId === this.workerRequestTokenId) {