#10787

Stefan
Participant

.

You can extend EmEditor yourself.
Just save a macro, add to My Macros, add an shortcut.
(or use Snippet plugin)

A macro could look like:

SwapWithLineAbove.jsee


document.selection.SelectLine(); //select line with cursor
cLine = document.selection.text; //store line to var
if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
document.selection.Delete(); //delete line
document.selection.LineUp(); //move cursor up one line
document.write(cLine); //paste line from var

or

MoveLineUp_(on-and-on).jsee
(assign to Shift+Alt+U)


document.selection.SelectLine(); //select line with cursor
cLine = document.selection.text; //store line to var
if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
document.selection.Delete(); //delete line
document.selection.LineUp(); //move cursor up on line
document.write(cLine); //paste line from var
document.selection.LineUp(); //move cursor up one line

and

MoveLineDown_(on-and-on).jsee
(assign to Shift+Alt+D)


document.selection.SelectLine(); //select line with cursor
cLine = document.selection.text; //store line to var
if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
document.selection.Delete(); //delete line
document.selection.LineDown(); //move cursor down one line
document.write(cLine); //paste line from var
document.selection.LineUp(); //move cursor up one line

– – –

Swap Lines UpSideDown.jsee

FROM:
1 – x
2 – Y
3 – Z
TO:
3 – Z
2 – Y
1 – x


Sel = document.selection.text;
SelArr = Sel.split("rn"); SelArr.reverse();
for(i=0,L=SelArr.length; i<L; i++){
document.selection.text = SelArr[i];
if(i<L-1){document.selection.text ="rn";}
}

.