Skip to content

Commit

Permalink
Use optional arg to EditorSelection.eq to simplify a bit of code
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Dec 28, 2023
1 parent d5beca5 commit fae01eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"sideEffects": false,
"license": "MIT",
"dependencies": {
"@codemirror/state": "^6.1.4",
"@codemirror/state": "^6.4.0",
"style-mod": "^4.1.0",
"w3c-keyname": "^2.2.4"
},
Expand Down
3 changes: 1 addition & 2 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ class MouseSelection {

select(event: MouseEvent) {
let {view} = this, selection = this.skipAtoms(this.style.get(event, this.extend, this.multiple))
if (this.mustSelect || !selection.eq(view.state.selection) ||
selection.main.assoc != view.state.selection.main.assoc && this.dragging === false)
if (this.mustSelect || !selection.eq(view.state.selection, this.dragging === false))
this.view.dispatch({
selection,
userEvent: "select.pointer"
Expand Down

0 comments on commit fae01eb

Please sign in to comment.