Skip to content

Commit

Permalink
Do dispatch selection changes that only differ in cursor associativity
Browse files Browse the repository at this point in the history
FIX: Fix an issue causing cursor motion commands to not dispatch a transaction
when the change only affects cursor associativity.
  • Loading branch information
marijnh committed Dec 22, 2023
1 parent 1f6d613 commit b299dc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.2.0",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.0.0",
"@lezer/common": "^1.1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type CommandTarget = {state: EditorState, dispatch: (tr: Transaction) => void}
function moveSel({state, dispatch}: CommandTarget,
how: (range: SelectionRange) => SelectionRange): boolean {
let selection = updateSel(state.selection, how)
if (selection.eq(state.selection)) return false
if (selection.eq(state.selection, true)) return false
dispatch(setSel(state, selection))
return true
}
Expand Down

0 comments on commit b299dc2

Please sign in to comment.