Comment detail

文字列のセンタリング (Nested Flatten)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    if ( getconfig( "AutoAdjustOrikaeshi" ) == 2 ) {
        #width = windowwidth;
    } else {
        #width = getconfig( "Orikaeshi" );
    }
    disabledraw;
    begingroupundo;
    if ( !selecting ) {
        selectall;
    }
    #i = seltoplineno;
    #end = selendlineno;
    escape;
    while( #i <= #end ) {
        movetolineno 1, #i;
        #margin = #width - linelen2;
        if ( #margin >= 0 ) {
            #j = #margin / 2;
            while( #j > 0 ) {
                insert " ";
                #j = #j - 1;
            }
        } else {
            while( linelen2 > #width ) {
                golineend2;
                backspace;
                if ( !linelen2 > #width ) {
                    break;
                }
                golinetop2
                delete;
            }
        }
        #i = #i + 1;
    }
    endgroupundo;
    enabledraw;

Index

Feed

Other

Link

Pathtraq

loading...