From aa6f7057810c7141e96230e1aaa0f3456c45ef77 Mon Sep 17 00:00:00 2001 From: Logesh Date: Sat, 31 Jan 2026 21:24:48 +0530 Subject: [PATCH] Avoid decorating attributes when cursor is in range (#1805) --- client/codemirror/attribute.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/codemirror/attribute.ts b/client/codemirror/attribute.ts index 5477945a..b4ffed6b 100644 --- a/client/codemirror/attribute.ts +++ b/client/codemirror/attribute.ts @@ -1,6 +1,9 @@ import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; -import { decoratorStateField } from "./util.ts"; +import { + decoratorStateField, + isCursorInRange, +} from "./util.ts"; export function attributePlugin() { return decoratorStateField((state) => { @@ -11,6 +14,9 @@ export function attributePlugin() { if (node.type.name !== "Attribute") { return; } + if (isCursorInRange(state, [node.from, node.to])) { + return; + } const attributeText = state.sliceDoc(node.from, node.to);