add discardCurrentSession fn

pull/1/head
yann300 7 years ago
parent ce2245e4b3
commit 7fed76ae82
  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