mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-26 04:48:05 +11:00
b22ab8437b
Kinda proud of this one. Efficiently piggy-backing on the Block Editor, keeping things simple, and yet, building power into the editor.
16 lines
499 B
Plaintext
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 ! ;
|