mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-05 15:10:55 +11:00
5bf3baff05
Also, add word "C!+" and fix PSP leak in FILL.
17 lines
472 B
Plaintext
17 lines
472 B
Plaintext
( Cursor position in buffer. EDPOS/64 is line number )
|
|
VARIABLE EDPOS
|
|
CREATE EDBUF 64 ALLOT
|
|
: _cpos BLK( + ;
|
|
: _lpos 64 * _cpos ;
|
|
: _pln ( lineno -- )
|
|
DUP _lpos DUP 64 + SWAP DO ( lno )
|
|
I EDPOS @ _cpos = IF '^' EMIT THEN
|
|
I C@ DUP 0x20 < IF DROP 0x20 THEN
|
|
EMIT
|
|
LOOP ( lno ) 1+ . ;
|
|
: _zbuf EDBUF 64 0 FILL ;
|
|
: _type ( -- )
|
|
C< DUP 0xd = IF DROP EXIT THEN _zbuf EDBUF BEGIN ( c a )
|
|
C!+ C< SWAP OVER 0x0d = UNTIL ( c a )
|
|
2DROP ;
|