Bläddra i källkod

VE: Add replace mode

pull/107/head
Virgil Dupras 4 år sedan
förälder
incheckning
a1b99275e6
4 ändrade filer med 12 tillägg och 5 borttagningar
  1. +4
    -0
      blk/122
  2. +0
    -1
      blk/126
  3. +6
    -2
      blk/128
  4. +2
    -2
      blk/129

+ 4
- 0
blk/122 Visa fil

@@ -4,3 +4,7 @@

'I' inserts text by calling the "I" command from the Block
editor.

'R' goes into replace mode at current cursor position.
Following keystrokes replace current character and advance
cursor. Press return to return to normal mode.

+ 0
- 1
blk/126 Visa fil

@@ -1,5 +1,4 @@
CREATE CMD 2 C, '$' C, 0 C,
VARIABLE MODE
: 0acc 0 ACC ! ;
: acc@ ACC @ 1 MAX 0acc ;
: num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ;


+ 6
- 2
blk/128 Visa fil

@@ -4,8 +4,12 @@
: $W EDPOS @ BLK( + acc@ 0 DO
BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP
1+ BLK( - DUP 0< IF DROP 0 THEN EDPOS ! ;
: handleM ( c -- f )
: $R ( replace mode )
mode! 'R' EMIT
BEGIN setpos C< DUP 0xd = NOT IF
EDPOS @ _cpos C! 1 EDPOS +! BLK!! 0
THEN UNTIL mode! SPC contents ;
: handle ( c -- f )
DUP '0' '9' =><= IF num 0 EXIT THEN
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
UPPER 'Q' = ;
: modeM ['] handleM MODE ! mode! SPC ;

+ 2
- 2
blk/129 Visa fil

@@ -7,7 +7,7 @@
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 EDPOS ! modeM contents
BEGIN status bufs setpos KEY MODE @ EXECUTE UNTIL
clrscr 0acc 0 EDPOS ! contents
BEGIN status bufs setpos KEY handle UNTIL
0 0x08 RAM+ ! 19 aty ;


Laddar…
Avbryt
Spara