1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-05 21:30:56 +11:00
collapseos/blk/127
2020-06-04 18:59:54 -04:00

16 lines
542 B
Plaintext

: setpos POS @ 64 /MOD
1+ ( status line ) SWAP 3 + ( gutter ) SWAP AT-XY ;
: pos+ POS @ + 1024 MOD POS ! ;
: cmv ( n -- , char movement ) acc@ * pos+ ;
: $; 0acc ;
: $g ACC @ selblk 0acc ;
: $[ BLK> @ acc@ - selblk ;
: $] BLK> @ acc@ + selblk ;
: $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ;
: $w POS @ BLK( + acc@ 0 DO
BEGIN C@+ WS? UNTIL BEGIN C@+ WS? NOT UNTIL LOOP
1- BLK( - 1023 MIN POS ! ;
: $W POS @ BLK( + acc@ 0 DO
BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP
1+ BLK( - DUP 0< IF DROP 0 THEN POS ! ;