summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorWu Cheng-Han2017-02-18 20:10:34 +0800
committerWu Cheng-Han2017-02-18 20:10:34 +0800
commitf7149f5a834ea79ec82f04ef2da257fe72f1b330 (patch)
tree3c48a8eac336efd90ee5dd6be4df2377be6461af /public
parent2aee0f267c2154ddf001507a62e4fe548515cd3a (diff)
Fix to keep selections on save and restore info
Diffstat (limited to '')
-rw-r--r--public/js/index.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 9b42e79c..3ad79d59 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -408,7 +408,8 @@ window.lastInfo = {
cursor: {
line: null,
ch: null
- }
+ },
+ selections: null
},
view: {
scroll: {
@@ -3394,6 +3395,7 @@ function saveInfo() {
break;
}
lastInfo.edit.cursor = editor.getCursor();
+ lastInfo.edit.selections = editor.listSelections();
lastInfo.needRestore = true;
}
@@ -3403,6 +3405,7 @@ function restoreInfo() {
var line = lastInfo.edit.cursor.line;
var ch = lastInfo.edit.cursor.ch;
editor.setCursor(line, ch);
+ editor.setSelections(lastInfo.edit.selections);
switch (currentMode) {
case modeType.edit:
if (scrollbarStyle == 'native') {