You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdelibs/kate/scripts/sort.js

18 lines
439 B

if( view.hasSelection() )
{
start = view.selectionStartLine;
end = view.selectionEndLine;
txt = document.textRange( start, 0, end, document.lineLength( end ) );
repl = txt.split("\n");
repl.sort();
txt = repl.join("\n");
view.clearSelection();
document.editBegin();
document.removeText( start, 0, end, document.lineLength( end ) );
document.insertText( start, 0, txt );
document.editEnd();
}