This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First we'll start an undo action, then Ctrl-Z will undo the actions of the whole script | |
editor.beginUndoAction() | |
selectionLength = editor.getSelectionEnd() - editor.getSelectionStart() | |
start = editor.getSelectionStart() if selectionLength > 0 else 0 | |
end = editor.getSelectionEnd() if selectionLength > 0 else editor.getLength() | |
# editor.replace("&", "&", 0, start, end) | |
editor.replace("<", "<", 0, start, end) |