2020-05-07 08:44:17 -04:00
|
|
|
: _blen ( buf -- length of str in buf )
|
|
|
|
DUP BEGIN C@+ EOL? UNTIL -^ 1- ;
|
|
|
|
: _rbufsz ( size of linebuf to the right of curpos )
|
|
|
|
EDPOS @ 64 MOD 63 -^ ;
|
2020-06-04 22:54:27 -04:00
|
|
|
: i COMPILE I ; IMMEDIATE ( save overshadowed )
|
2020-06-08 21:23:23 -04:00
|
|
|
: _I ( I without _pln and _type. used in VE )
|
|
|
|
_rbufsz IBUF _blen 2DUP > IF
|
2020-05-22 14:17:38 -04:00
|
|
|
TUCK - ( ilen chars-to-move )
|
2020-05-06 21:10:27 -04:00
|
|
|
SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen )
|
|
|
|
3 PICK MOVE- ( ctm ilen )
|
2020-05-22 14:03:12 -04:00
|
|
|
NIP ( ilen )
|
2020-05-06 21:10:27 -04:00
|
|
|
ELSE DROP ( ilen becomes rbuffsize )
|
2020-05-06 12:19:36 -04:00
|
|
|
THEN
|
2020-06-05 13:54:45 -04:00
|
|
|
DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen ) EDPOS +! BLK!! ;
|
2020-06-08 21:23:23 -04:00
|
|
|
: I IBUF _type _I EDPOS @ 64 / _pln ;
|