Change:
// The selection must be inside a word or surround one word at most if (!word || word.startColumn > startColumn || word.endColumn < endColumn) { // no previous query, nothing to highlight <ins> WordHighlighter.query = null; </ins> this._stopAll(); return; }

Discussion:
<!-- Please search existing issues to avoid creating duplicates. --- VS Code version: 1.84.2 Jupyter Extension version (available under the Extensions sidebar): v2023.10. Python Extension version (available under the Extensions sidebar): v2023.20.0 OS (Windows Linux distro) and version: Windows 10, Ubuntu 22.04 Python and/or Anaconda version: 3.11.6 Type of virtual environment used (N/A ...): N/A Jupyter server running: Remote If I highlight a variable or word in a notebook I would like that to persist. If I do not highlight anything myself, I do not expect anything to become highlighted. I do not expect to scroll up and down throughout the notebook and see random bits of code automatically highlighted for no discernible reason, if I have not highlighted anything myself. It is annoying and distracting. Highlights not created by the user are a distraction. Random things are highlighted by VSCode without me doing so. It appears to be related to the last location of the cursor. Whatever was near the cursor, in whatever cell, even if it's not on the same row as the cursor, will be highlighted throughout the whole notebook! There is no "safe space" where you could "park" the cursor for this to not happen. VSCode will insist, no matter what you do, that it knows better than you, and will go on a highlighting spree all over your code. Very annoying. Just write code in a Jupyter Notebook in VSCode. As you scroll up and down, you will notice random chunks of code being highlighted that you've never highlighted. Very weird. E.g. no idea why is highlighted in this screenshot. I've probably parked the cursor, a while ago, near in a cell. As a result, now VSCode desperately insists that it must draw my attention to this variable everywhere, no matter what. "Look at this! Look at it! Watch it now!" lol ! I don't need to pay attention to that variable. It's a distraction. It's counter-productive.

<details<summaryOutput for <codeJupyter</codein the <codeOutput</codepanel (<codeView</code→<codeOutput</code, change the drop-down the upper-right of the <codeOutput</codepanel to <codeJupyter</code) </summary<p</p</details
What's worse, different variables will randomly be highlighted as you scroll up and down. What is highlighted depends on where you are in the notebook. This is completely pointless.
As I open old notebooks, without even starting an interpreter for them, and as I scroll up and down through the code, there are also random highlights that change from one cell to another for no apparent reason. Something insists on highlighting all things in the code. That something needs to stop.
Yep, this bug was accidentally introduced alongside setting up highlighting across notebook cells. I will likely introduce a setting to allow a user to turn off multi-cell highlighting (as currently it's default) as I take care of this bug and improve the behavior as a whole. This is currently in the works.

something in a cell that will add a highlight to the cell above somewhere else to remove the highlight the top cell out of view then back in highlight is re- repro'd on the 1.84 RC and OSS !