doc.getCursor returns a
JSObject object from which you can extract the line and ch members:
B4X:
Public Sub GetCursor As Map
Dim JSO As JavaObject = ExecuteScript("doc.getCursor()") 'Returns a JSObject Object
Return CreateMap("line": JSO.RunMethod("getMember",Array("line")),"ch":JSO.RunMethod("getMember",Array("ch")))
End Sub
Usage:
B4X:
Dim M As Map = CodeMirrorWrapper1.GetCursor
Log(M.Get("line"))
Log(M.Get("ch"))
Using the lineComment requires more javascript knowledge / time than I currently have. There is an example
here which may help, there are more if you search.