问题
I look into docs and also pick at the source code and I dind't find anything, all I see is selection and range objects, and methods that manipulate ranges.
回答1:
It's better to use editor.getSelectedText()
instead.
回答2:
Found in Ace editor source code:
editor.getSession().doc.getTextRange(editor.selection.getRange());
来源:https://stackoverflow.com/questions/23996814/how-can-i-get-selected-text-in-ace-editor