1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 22:28:06 +11:00

VE: use system input buffer for IBUF and FBUF typing

This gives us backspace handling. Also, remove all usages of C<
which allows us to remove the C<* override.
This commit is contained in:
Virgil Dupras 2020-06-11 20:31:18 -04:00
parent 4146110e0d
commit e317e9cc78
3 changed files with 10 additions and 9 deletions

View File

@ -4,10 +4,11 @@
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 ;
3 OVER AT-XY KEY DUP EMIT
DUP 0x20 < IF 2DROP DROP EXIT THEN
( buf ln c ) 63 nspcs SWAP 4 SWAP AT-XY ( buf c ) SWAP C!+
IN( _zbuf (rdln) IN( SWAP 63 MOVE ;

View File

@ -4,8 +4,8 @@
SWAP _cpos FBUF ( len src dst ) ROT MOVE ;
: $R ( replace mode )
mode! 'R' EMIT
BEGIN setpos C< DUP 0xd = NOT IF
EDPOS @ _cpos C! 1 EDPOS +! BLK!! 0
BEGIN setpos KEY DUP 0x20 >= IF
DUP EMIT EDPOS @ _cpos C! 1 EDPOS +! BLK!! 0
THEN UNTIL mode! SPC contents ;
: $O EDPOS @ 0x3c0 ( 15 * 64 ) >= IF EXIT THEN
_U EDPOS @ 0x3c0 AND DUP pos! _cpos _zbuf BLK!! contents ;

View File

@ -7,10 +7,10 @@
: bufs
1 aty ." I: " IBUF bufp
2 aty ." F: " FBUF bufp 0 3 gutter ;
: c<over KEY DUP EMIT DUP 0x0a = IF DROP 0x0d THEN ;
: VE ['] c<over 0x08 ( C< override ) RAM+ !
: VE
clrscr 0 ACC ! 0 PREVPOS ! contents
BEGIN status bufs setpos KEY handle UNTIL
0 0x08 RAM+ ! 19 aty ;
19 aty ;