Commit 7fed76ae authored by yann300's avatar yann300

add discardCurrentSession fn

parent ce2245e4
......@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment