From e317e9cc782ae221d5fdf6b93ca3b471d1493128 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 11 Jun 2020 20:31:18 -0400 Subject: [PATCH] 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. --- blk/127 | 9 +++++---- blk/130 | 4 ++-- blk/131 | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/blk/127 b/blk/127 index 1b3a916..d389a87 100644 --- a/blk/127 +++ b/blk/127 @@ -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 ; + diff --git a/blk/130 b/blk/130 index 5908983..1d18fc1 100644 --- a/blk/130 +++ b/blk/130 @@ -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 ; diff --git a/blk/131 b/blk/131 index 76f0470..c3967db 100644 --- a/blk/131 +++ b/blk/131 @@ -7,10 +7,10 @@ : bufs 1 aty ." I: " IBUF bufp 2 aty ." F: " FBUF bufp 0 3 gutter ; -: c