Skip to content

Commit

Permalink
Return false from selectParentSyntax when it makes no changes
Browse files Browse the repository at this point in the history
FIX: Make `selectParentSyntax` return false when it doesn't change the selection.

Issue codemirror/dev#1436
  • Loading branch information
marijnh committed Sep 7, 2024
1 parent cf29578 commit f5caca0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f5caca0

Please sign in to comment.