Skip to content

Commit

Permalink
fix 448831e: restore sublime bookmarks correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Feb 3, 2024
1 parent 4930b41 commit 0a21149
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion edit/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ function EditorMethods() {
applyScrollInfo(cm, si = (editor.scrollInfo.cms || [])[0]) {
if (si && si.sel) {
const bmOpts = {sublimeBookmark: true, clearWhenEmpty: false}; // copied from sublime.js
const bms = cm.state.sublimeBookmarks = [];
for (const b of si.bookmarks) bms.push(cm.markText(b.from, b.to, bmOpts));
cm.setSelections(...si.sel, {scroll: false});
cm.state.sublimeBookmarks = si.bookmarks.map(b => cm.markText(b.from, b.to, bmOpts));
Object.assign(cm.display.scroller, si.scroll); // for source editor
Object.assign(cm.doc, si.scroll); // for sectioned editor
}
Expand Down

0 comments on commit 0a21149

Please sign in to comment.