VE: make ACC reset after each non-digit keystrokes

It simplifies things. Also, removed ';' which became useless.
This commit is contained in:
Virgil Dupras 2020-06-10 16:54:36 -04:00
parent c16c5c98ce
commit 6a6c59300e
4 changed files with 7 additions and 9 deletions

View File

@ -13,4 +13,4 @@ saved beforehand.
'[' and ']' advances the selected block by "modifier".
';' resets the modifier. 'q' quits. (cont.)
(cont.)

View File

@ -1,7 +1,6 @@
CREATE CMD 2 C, '$' C, 0 C,
VARIABLE PREVPOS
: 0acc 0 ACC ! ;
: acc@ ACC @ 1 MAX 0acc ;
: acc@ ACC @ 1 MAX ;
: num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ;
: nspcs ( n -- , spit n space ) 0 DO SPC LOOP ;
: aty 0 SWAP AT-XY ;

View File

@ -1,5 +1,4 @@
: $; 0acc ;
: $g ACC @ selblk 0acc ;
: $g ACC @ selblk ;
: $[ BLK> @ acc@ - selblk ;
: $] BLK> @ acc@ + selblk ;
: $I mode! 'I' EMIT IBUF 1 buftype _I contents mode! SPC ;
@ -7,6 +6,6 @@
: $E E contents ;
: $X acc@ X contents ;
: $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ;
: $H 0acc EDPOS @ 0x3c0 AND pos! ;
: $L 0acc EDPOS @ 0x3f OR pos! ;
: $H EDPOS @ 0x3c0 AND pos! ;
: $L EDPOS @ 0x3f OR pos! ;

View File

@ -1,7 +1,7 @@
: handle ( c -- f )
DUP '0' '9' =><= IF num 0 EXIT THEN
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
UPPER 'Q' = ;
0 ACC ! UPPER 'Q' = ;
: bufp ( buf -- )
DUP 64 + SWAP DO i C@ 0x20 MAX EMIT LOOP ;
: bufs
@ -9,6 +9,6 @@
2 aty ." F: " FBUF bufp ;
: c<over KEY DUP EMIT DUP 0x0a = IF DROP 0x0d THEN ;
: VE ['] c<over 0x08 ( C< override ) RAM+ !
clrscr 0acc 0 PREVPOS ! contents
clrscr 0 ACC ! 0 PREVPOS ! contents
BEGIN status bufs setpos KEY handle UNTIL
0 0x08 RAM+ ! 19 aty ;