Skip to content

Commit

Permalink
fix: get editor from among the visible editors instead of active editor
Browse files Browse the repository at this point in the history
  • Loading branch information
usernamehw committed Dec 16, 2024
1 parent ee43feb commit dcfab71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/decorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Constants } from 'src/types';
import { extUtils, type GroupedByLineDiagnostics } from 'src/utils/extUtils';
import { createMultilineDecorations, showMultilineDecoration } from 'src/utils/showMultilineDecoration';
import { utils } from 'src/utils/utils';
import { vscodeUtils } from 'src/utils/vscodeUtils';
import { DecorationRangeBehavior, DiagnosticSeverity, Range, ThemeColor, languages, window, workspace, type DecorationInstanceRenderOptions, type DecorationOptions, type DecorationRenderOptions, type ExtensionContext, type TextEditor, type TextEditorDecorationType, type ThemableDecorationAttachmentRenderOptions, type Uri } from 'vscode';

type DecorationKeys =
Expand Down Expand Up @@ -581,7 +582,7 @@ export function updateDecorationsForUri({
range?: Range;
}): void {
if (editor === undefined) {
editor = window.activeTextEditor;
editor = vscodeUtils.getEditorByUri(uri);
}

if (!editor) {
Expand Down

0 comments on commit dcfab71

Please sign in to comment.