make cursor position controlled property of state

This commit is contained in:
Dmitry Vasilev
2022-12-03 03:17:01 +08:00
parent e235704455
commit e3a742ae77
6 changed files with 150 additions and 180 deletions

View File

@@ -416,9 +416,9 @@ export class Editor {
? this.ace_editor.getSession()
: this.get_session(file)
// Session was not created for file
if(session == null) {
return null
// Session was not created for file
throw new Error('illegal state')
}
return session.doc.positionToIndex(session.selection.getCursor())