1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-09-05 16:38:44 +10:00
collapseos/blk/127
Virgil Dupras 4d893d90fc VE: Improve I and F buffer typing
Previously, it would keep the old buffer displayed why typing over
it. I had kept it thus because I didn't want to erase the buffer
right away because the behavior is that when we type nothing, we
keep the buffer as-is and repeat the action.

Now, the behavior of I and F is much better. It keeps the buffer
displayed until the first non-return keystroke and then erases it.

Also, fixed PSP leak in _type and fixed PSP overuse in successful
_F (they balanced out).
2020-06-08 21:23:23 -04:00

11 lines
434 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 BEGIN ( c a )
C!+ C< TUCK 0x0d = UNTIL ( c a ) C! ;