Hello,
I want to know if you can guide me how can i get Current Line Information i mean text and Line Change Event in the Editor.
Also how can i Indent / outdent the line Text
Regards,
Khurram
@itskhurram
You can get the current line text via: editor.getModel().getLineContent(editor.getPosition().lineNumber)
There are many events on the editor such as editor.onDidChangeModelContent(function(e) { console.log(e); })
You can invoke the indent action via editor.trigger('anyString', 'editor.action.indentLines', null) and the outdent via editor.trigger('anyString', 'editor.action.outdentLines', null)
Thanks.
Most helpful comment
@itskhurram
You can get the current line text via:
editor.getModel().getLineContent(editor.getPosition().lineNumber)There are many events on the editor such as
editor.onDidChangeModelContent(function(e) { console.log(e); })You can invoke the indent action via
editor.trigger('anyString', 'editor.action.indentLines', null)and the outdent viaeditor.trigger('anyString', 'editor.action.outdentLines', null)