Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Commit 8364073

Browse files
committed
Properly preserve selection associativity in selection-extending commands
FIX: Make sure selection-extending commands preserve the associativity of the selection head. Issue codemirror/dev#1681
1 parent aa61d5c commit 8364073

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"license": "MIT",
2828
"dependencies": {
2929
"@codemirror/language": "^6.0.0",
30-
"@codemirror/state": "^6.4.0",
30+
"@codemirror/state": "^6.6.0",
3131
"@codemirror/view": "^6.27.0",
3232
"@lezer/common": "^1.1.0"
3333
},

src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ export const selectMatchingBracket: StateCommand = ({state, dispatch}) => toMatc
311311
function extendSel(target: CommandTarget, how: (range: SelectionRange) => SelectionRange): boolean {
312312
let selection = updateSel(target.state.selection, range => {
313313
let head = how(range)
314-
return EditorSelection.range(range.anchor, head.head, head.goalColumn, head.bidiLevel || undefined)
314+
return EditorSelection.range(range.anchor, head.head, head.goalColumn, head.bidiLevel || undefined, head.assoc)
315315
})
316316
if (selection.eq(target.state.selection)) return false
317317
target.dispatch(setSel(target.state, selection))

0 commit comments

Comments
 (0)