Skip to content

Commit f7149f5

Browse files
committed
Fix to keep selections on save and restore info
1 parent 2aee0f2 commit f7149f5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

public/js/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ window.lastInfo = {
408408
cursor: {
409409
line: null,
410410
ch: null
411-
}
411+
},
412+
selections: null
412413
},
413414
view: {
414415
scroll: {
@@ -3394,6 +3395,7 @@ function saveInfo() {
33943395
break;
33953396
}
33963397
lastInfo.edit.cursor = editor.getCursor();
3398+
lastInfo.edit.selections = editor.listSelections();
33973399
lastInfo.needRestore = true;
33983400
}
33993401

@@ -3403,6 +3405,7 @@ function restoreInfo() {
34033405
var line = lastInfo.edit.cursor.line;
34043406
var ch = lastInfo.edit.cursor.ch;
34053407
editor.setCursor(line, ch);
3408+
editor.setSelections(lastInfo.edit.selections);
34063409
switch (currentMode) {
34073410
case modeType.edit:
34083411
if (scrollbarStyle == 'native') {

0 commit comments

Comments
 (0)