[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Move blocks up or down--nifty functions



I've been using Notepad++, which has some cool little functions. One of
them is to move a DeFined block up or down. I've written the equivalent as
U2 frames: MoveBlockUp and MoveBlockDown
The way these work, if you having nothing DeFined (not even begun defining
a block, so that va$df is 0) it will do a DL to define the line the cursor
is on. If you have DeFined a block, whether the DeFine has been completed
or not, the routines will honor that DeFinition and move the whole selected
block up or down.
Notepad++ uses ctrl-shift up/down (not the NumPad arrows, the normal ones)
to trigger their macro, so I have adopted that:

Table=Ctrl+Shift

100=nojm,(,2,.,M,o,v,e,B,l,o,c,k,U,p,)
102=nojm,(,2,.,M,o,v,e,B,l,o,c,k,D,o,w,n,)

Surprisingly handy routines.


XPLeNCODE v2.0 (ENCODE.A3X)
b-gin [UNTITLED]
{123}{123}5MoveBlockUp{125}{125} As in Notepad{043}{043}. For{032}
ctrl-shift up arrow. HB 12/10/17[cr|lf]{002}[DF_]{<}IF{<}VA$DE
{>}<>1{>}[XD_][DL_]{<}EI{>};*; if hadn't defined anything def{032}
the line[cr|lf][DB_][LU_][LB_]{<}SV01{>}{<}SX02,{<}VA|01{>}{>}
{<}SX03,{<}CP{>}{>}[MV_][DF_][BX_]jmp {<}PV03{>}[Q2_][DF_]{<}E
X{>}{002} [cr|lf][cr|lf]{123}{123}5MoveBlockDown{125}{125} Lik
e Notepad{043}{043}. For ctrl-shift down arrow. HB 12/10/17[cr|lf]
{002}[DF_]{<}IF{<}VA$DE{>}<>1{>}[XD_][DL_]{<}EI{>};*; if hadn'
t defined anything def the line[cr|lf][LD_][LB_]{<}SV01{>}{<}S
X02,{<}VA|01{>}{>}[MV_]{<}SX03,{<}CP{>}-{<}PV02{>}{>}[DF_][BX_]
jmp {<}PV03{>}[Q2_][DF_][DE_]{<}EX{>}{002} [cr|lf][cr|lf]
-nd
XPLeNCODE