Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This script will imitate SciTE's Ctrl-D behaviour
- // That is, dublicate the line or dublicate the selection
- // FichteFoll, 26.02.2012
- // wrap into an anonymous function
- (function() {
- // aliases
- var ue = UltraEdit;
- var doc = ue.activeDocument;
- //~ var out = ue.outputWindow;
- if (!doc.isSel()) {
- // just dublicate the current line if there is no selection
- doc.dupeLine();
- out.write(doc.selection);
- }
- else {
- var sel = doc.selection, pos = [doc.currentLineNum, doc.currentColumnNum];
- doc.gotoLine(pos[0], pos[1]); // will go to the start of the selection, i.e. first selected char
- doc.write(sel);
- // select the previously selected text again
- doc.gotoLineSelect(pos[0], pos[1]);
- }
- return 1;
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement