How to get selected text in Ace editor?

I look through documents, and also select the source code, and I find nothing, all I see are selection and range objects, as well as methods that control ranges.

+6
source share
2 answers

It is better to use editor.getSelectedText() instead.

+16
source

Found in the source code of the Ace editor:

 editor.getSession().doc.getTextRange(editor.selection.getRange()); 
+5
source

Source: https://habr.com/ru/post/970188/


All Articles