John:
On Mon, 07 Feb 2005 14:42:00 -0500, you wrote:
>On Mon, 7 Feb 2005 12:23:24 -0500 GMT, Christian Ziemski wrote:
>
>> I would try it half-manually:
>
>> 1.) .
>> 2.) ..
>> 3.) ...
>
>Sounds like a good approach.
>
>> Perhaps there is an easier way using different block modes while
>> inserting. No time to test yet...
Now I spent some minutes before end-of-day...
Here my quick solution as starting point:
Before:
aaaaaaaaaaaaaaa Bbbbbbbbbbbbbbb
aaaaaaaaaaaaaaa bbbbbbbbbbbbbbb
aaaaaaaaaaaaaaa bbbbbbbbbbbbbbb
aaaaaaaaaaaaaaa bbbbbbbbbbbbbbB
CCCCCCCCCCCCCCC DDDDDDDDDDDDDDD
CCCCCCCCCCCCCCC DDDDDDDDDDDDDDD
CCCCCCCCCCCCCCC DDDDDDDDDDDDDDD
After:
aaaaaaaaaaaaaaa
aaaaaaaaaaaaaaa
aaaaaaaaaaaaaaa
aaaaaaaaaaaaaaa
Bbbbbbbbbbbbbbb
bbbbbbbbbbbbbbb
bbbbbbbbbbbbbbb
bbbbbbbbbbbbbbB
CCCCCCCCCCCCCCC DDDDDDDDDDDDDDD
CCCCCCCCCCCCCCC DDDDDDDDDDDDDDD
CCCCCCCCCCCCCCC DDDDDDDDDDDDDDD
// First solution with automatic positioning
//
// Assign the macro below to a key.
// Then highlight the b's as columnar block.
// Then press that key.
// ==> The highlighted block will be moved right below the a's.
if ((Block_Begin!=-1) && (Block_End!=-1) && (Block_Mode==COLUMN)) {
#103=Min(Block_Begin, Block_End)
#104=Max(Block_Begin, Block_End)
#104++
Set_Marker(9, #104)
Reg_Copy_Block(103, #103, #104, COLUMN+DELETE)
Block_Begin(CLEAR)
Goto_Pos(Marker(9))
Line(1, NOERR)
Ins_Newline(1)
Reg_Ins(103, RAW) // insert block as STREAM
}
// Second solution with inserting at user's cursor position
//
// Assign the macro below to a key.
// Then highlight the b's as columnar block.
// Then position the cursor to the place where the block should be
// moved to.
// Then press that key.
if ((Block_Begin!=-1) && (Block_End!=-1) && (Block_Mode==COLUMN)) {
Set_Marker(9, Cur_Pos)
#103=Min(Block_Begin, Block_End)
#104=Max(Block_Begin, Block_End)
#104++
Reg_Copy_Block(103, #103, #104, COLUMN+DELETE)
Block_Begin(CLEAR)
Goto_Pos(Marker(9))
Ins_Newline(1) // optionally
Reg_Ins(103, RAW) // insert block as STREAM
}
Christian
|
|