mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-05 21:30:56 +11:00
e83d5073ba
When reaching the end of the buffer when typing in IBUF or FBUF, stop typing instead of overflowing.
11 lines
443 B
Plaintext
11 lines
443 B
Plaintext
: pos! ( newpos -- ) EDPOS @ PREVPOS !
|
|
DUP 0< IF DROP 0 THEN 1023 MIN EDPOS ! ;
|
|
: setpos ( -- ) EDPOS @ 64 /MOD
|
|
3 + ( header ) SWAP 3 + ( gutter ) SWAP AT-XY ;
|
|
: cmv ( n -- , char movement ) acc@ * EDPOS @ + pos! ;
|
|
: buftype ( buf ln -- )
|
|
3 OVER AT-XY C< DUP 0xd = IF 2DROP DROP EXIT THEN
|
|
( buf ln c ) 63 nspcs SWAP 4 SWAP AT-XY ( buf c )
|
|
SWAP DUP _zbuf C!+ DUP 63 + SWAP DO
|
|
C< DUP 0x0d = IF LEAVE THEN i C! LOOP ;
|