Now works on selected text, if no selection then the whole editor