Commit 94a25953 authored by yann300's avatar yann300

add getCursorPosition fn to editor

parent 13d78ece
...@@ -126,6 +126,10 @@ function Editor (opts = {}) { ...@@ -126,6 +126,10 @@ function Editor (opts = {}) {
return currentSession return currentSession
} }
this.getCursorPosition = function () {
return editor.session.doc.positionToIndex(editor.getCursorPosition(), 0)
}
this.discard = function (path) { this.discard = function (path) {
if (currentSession !== path) { if (currentSession !== path) {
delete sessions[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