2020-04-30 20:42:07 -04:00
|
|
|
( Cursor position in buffer. EDPOS/64 is line number )
|
2020-04-16 15:59:43 -04:00
|
|
|
VARIABLE EDPOS
|
2020-04-30 20:42:07 -04:00
|
|
|
: _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+ . ;
|
|
|
|
( user-facing lines are 1-based )
|
|
|
|
: T 1- DUP 64 * EDPOS ! _pln ;
|