2020-05-07 22:44:17 +10: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-05-07 11:10:27 +10:00
|
|
|
: _I
|
2020-05-07 22:44:17 +10:00
|
|
|
IBUF _type _rbufsz IBUF _blen 2DUP > IF
|
2020-05-23 04:17:38 +10:00
|
|
|
TUCK - ( ilen chars-to-move )
|
2020-05-07 11:10:27 +10:00
|
|
|
SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen )
|
|
|
|
3 PICK MOVE- ( ctm ilen )
|
2020-05-23 04:03:12 +10:00
|
|
|
NIP ( ilen )
|
2020-05-07 11:10:27 +10:00
|
|
|
ELSE DROP ( ilen becomes rbuffsize )
|
2020-05-07 02:19:36 +10:00
|
|
|
THEN
|
2020-05-07 11:10:27 +10:00
|
|
|
DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen )
|
2020-05-07 07:41:49 +10:00
|
|
|
EDPOS +! EDPOS @ 64 / _pln
|
2020-05-07 02:19:36 +10:00
|
|
|
;
|