VE: add mode indicator in status bar

This commit is contained in:
Virgil Dupras 2020-06-04 20:07:02 -04:00
parent 2bf4db59ed
commit 297c187426
4 changed files with 9 additions and 9 deletions

View File

@ -1,2 +1,2 @@
'? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 )
1 3 LOADR+
1 4 LOADR+

View File

@ -1,5 +1,5 @@
CREATE CMD 2 C, '$' C, 0 C,
VARIABLE MODE VARIABLE ACC VARIABLE POS
VARIABLE MODE VARIABLE MODEC VARIABLE ACC VARIABLE POS
: 0acc 0 ACC ! ;
: acc@ ACC @ 1 MAX 0acc ;
: num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ;
@ -8,6 +8,6 @@ VARIABLE MODE VARIABLE ACC VARIABLE POS
: clrln DUP aty COLS nspcs aty ;
: clrscr LINES 0 DO I clrln LOOP ;
: status 0 clrln ." BLK" SPC BLK> ? SPC ACC ?
SPC POS @ 64 /MOD . ',' EMIT . ;
SPC POS @ 64 /MOD . ',' EMIT . SPC MODEC C@ EMIT ;
: contents 1 aty BLK> @ LIST ;
: selblk BLK@ contents ;

View File

@ -4,11 +4,8 @@
: $W POS @ BLK( + acc@ 0 DO
BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP
1+ BLK( - DUP 0< IF DROP 0 THEN POS ! ;
: modeM EXECUTE ;
: handle ( c -- f )
: handleM ( c -- f )
DUP '0' '9' =><= IF num 0 EXIT THEN
DUP CMD 2+ C! CMD FIND IF MODE @ EXECUTE ELSE DROP THEN
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
UPPER 'Q' = ;
: VE clrscr 0acc 0 POS ! ['] modeM MODE ! contents
BEGIN status setpos KEY handle UNTIL 18 aty ;
: modeM ['] handleM MODE ! 'M' MODEC C! ;

3
blk/129 Normal file
View File

@ -0,0 +1,3 @@
: VE clrscr 0acc 0 POS ! modeM contents
BEGIN status setpos KEY MODE @ EXECUTE UNTIL 18 aty ;