Skip to content

Commit

Permalink
Merge pull request #34 from alissa-tung/patch-1
Browse files Browse the repository at this point in the history
fix undo and redo scroll
  • Loading branch information
dmonad authored Jun 18, 2024
2 parents faffa7b + b00d06b commit 63f7957
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/y-undomanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ class YUndoManagerPluginValue {
const sel = stackItem.meta.get(this)
if (sel) {
const selection = this.syncConf.fromYRange(sel)
view.dispatch(view.state.update({ selection }))
view.dispatch(view.state.update({
selection,
effects: [cmView.EditorView.scrollIntoView(selection)]
}))
this._storeSelection()
}
}
Expand Down

0 comments on commit 63f7957

Please sign in to comment.