From f5caca055b8983ac6a95c967f6f5b1b8ffe59c60 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Sat, 7 Sep 2024 12:56:59 +0200 Subject: [PATCH] Return false from selectParentSyntax when it makes no changes FIX: Make `selectParentSyntax` return false when it doesn't change the selection. Issue https://github.com/codemirror/dev/issues/1436 --- src/commands.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands.ts b/src/commands.ts index 037d7f6..ff6b8fe 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -415,6 +415,7 @@ export const selectParentSyntax: StateCommand = ({state, dispatch}) => { } return range }) + if (selection.eq(state.selection)) return false dispatch(setSel(state, selection)) return true }