Skip to content

Commit

Permalink
Preserve bidi level in selection extending
Browse files Browse the repository at this point in the history
FIX: Preserve selection bidi level when extending the selection, to prevent
shift-selection from getting stuck in some kinds of bidirectional text.

Closes codemirror/dev#1045
  • Loading branch information
marijnh committed Dec 26, 2022
1 parent 6aa9989 commit b3ab4df
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.0.0",
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.0.0",
"@lezer/common": "^1.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export const selectMatchingBracket: StateCommand = ({state, dispatch}) => toMatc
function extendSel(view: EditorView, how: (range: SelectionRange) => SelectionRange): boolean {
let selection = updateSel(view.state.selection, range => {
let head = how(range)
return EditorSelection.range(range.anchor, head.head, head.goalColumn)
return EditorSelection.range(range.anchor, head.head, head.goalColumn, head.bidiLevel || undefined)
})
if (selection.eq(view.state.selection)) return false
view.dispatch(setSel(view.state, selection))
Expand Down

0 comments on commit b3ab4df

Please sign in to comment.