From 963c934a937b0fe6e8e771d76d355cf29477a60b Mon Sep 17 00:00:00 2001 From: Michael Lively Date: Mon, 24 Feb 2025 15:58:07 -0800 Subject: [PATCH] Fix flicker when typing in notebooks -- aggressive hueristic (#241784) fix flicker when typing in notebooks -- aggressive hueristic --- .../wordHighlighter/browser/wordHighlighter.ts | 2 +- .../contrib/multicursor/notebookMulticursor.ts | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts index de82ea26de3d2..118a9e66da401 100644 --- a/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.ts @@ -548,7 +548,7 @@ class WordHighlighter { // ignore typing & other // need to check if the model is a notebook cell, should not stop if nb - if (e.source !== 'api' && e.reason !== CursorChangeReason.Explicit && this.editor.getModel()?.uri.scheme !== Schemas.vscodeNotebookCell) { + if (e.source !== 'api' && e.reason !== CursorChangeReason.Explicit) { this._stopAll(); return; } diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.ts b/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.ts index 8d0938fceac9a..8ce231cbd2499 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.ts @@ -31,7 +31,6 @@ import { indentOfLine } from '../../../../../../editor/common/model/textModel.js import { ITextModelService } from '../../../../../../editor/common/services/resolverService.js'; import { ICoordinatesConverter } from '../../../../../../editor/common/viewModel.js'; import { ViewModelEventsCollector } from '../../../../../../editor/common/viewModelEventDispatcher.js'; -import { WordHighlighterContribution } from '../../../../../../editor/contrib/wordHighlighter/browser/wordHighlighter.js'; import { IAccessibilityService } from '../../../../../../platform/accessibility/common/accessibility.js'; import { MenuId, registerAction2 } from '../../../../../../platform/actions/common/actions.js'; import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.js'; @@ -886,21 +885,6 @@ export class NotebookMultiCursorController extends Disposable implements INotebo cell.decorationIds, newDecorations ); - - /** - * TODO: @Yoyokrazy debt - * goal: draw decorations for occurrence higlight on the cursor blink cycle - * - * Trigger WH with delay: x ms (x = cursor blink cycle) - * -> start = Date() - * -> WordHighlighter -> compute - * -> end = Date() - * -> delay = x - ((end - start) % x) - */ - const matchingEditor = this.notebookEditor.codeEditors.find(cellEditor => cellEditor[0] === cell.cellViewModel); - if (matchingEditor) { - WordHighlighterContribution.get(matchingEditor[1])?.wordHighlighter?.trigger(); - } }); }