1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 17:38:05 +11:00
collapseos/blk/126
Virgil Dupras b22ab8437b VE: add command 'f'
Kinda proud of this one. Efficiently piggy-backing on the Block
Editor, keeping things simple, and yet, building power into the
editor.
2020-06-06 21:46:46 -04:00

16 lines
499 B
Plaintext

CREATE CMD 2 C, '$' C, 0 C,
VARIABLE PREVPOS
: 0acc 0 ACC ! ;
: acc@ ACC @ 1 MAX 0acc ;
: num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ;
: nspcs ( n -- , spit n space ) 0 DO SPC LOOP ;
: aty 0 SWAP AT-XY ;
: clrscr LINES 0 DO i aty COLS nspcs LOOP ;
: status 0 aty ." BLK" SPC BLK> ? SPC ACC ?
SPC EDPOS @ 64 /MOD . ',' EMIT . 10 nspcs ;
: contents 3 aty BLK> @ LIST ;
: selblk BLK@ contents ;
: mode! ( c -- ) 63 0 AT-XY ;
: pos! EDPOS @ PREVPOS !
1023 MIN DUP 0< IF DROP 0 THEN EDPOS ! ;