pspad:
--------------------------------------------------------------------------------
Use PSPad scripting and write simple script for it
--------------------------------------------------------------------------------


Indeed, just two trivial functions needed - to save the caret position and
select text and, reversely, restore the caret position. (if deselect is called
alone, it will eventually move the caret to the previously saved coordinates).
The following text can be saved in the given location and if the WSH is enabled
in PSPad system settings, after Scripts :: Recompile, there should be new
entries in this menu; the keyboard shortcuts can be modified as needed.



////// ... PSPad\script\JScript\selectAll.js ////////
var module_name = "SelectAll";
var module_ver = "1";

var memCaretPosX=-1;
var memCaretPosY=-1;
function selectAllSaveCaret(){
if (editorsCount()<1){return;}
var actEd = newEditor();
actEd.assignActiveEditor();
memCaretPosX=actEd.caretX();
memCaretPosY=actEd.caretY();
runPSPadAction("aSelectAll");
}

function deselectRestoreCaret(){
if (editorsCount()<1){return;}
var actEd = newEditor();
actEd.assignActiveEditor();
actEd.setCaretPos(memCaretPosX, memCaretPosY)
}


function Init(){
addMenuItem("select all + save caret", "",
"selectAllSaveCaret","Ctrl+Alt+Shift+A");
addMenuItem("restore caret", "", "deselectRestoreCaret","Ctrl+Alt+Shift+D");
}

-- 
<http://forum.pspad.com/read.php?2,48731,48733>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem