add discardCurrentSession fn

pull/3094/head
yann300 7 years ago
parent d7b96b36bb
commit 3e5fdabf3f
  1. 7
      src/app/editor/editor.js

@ -186,6 +186,13 @@ function Editor (opts = {}) {
return editor.session.doc.positionToIndex(editor.getCursorPosition(), 0)
}
this.discardCurrentSession = function () {
if (sessions[currentSession]) {
delete sessions[currentSession]
currentSession = null
}
}
this.discard = function (path) {
if (currentSession !== path) {
delete sessions[path]

Loading…
Cancel
Save