2020-06-06 21:46:46 -04:00
|
|
|
: $f EDPOS @ PREVPOS @ 2DUP = IF 2DROP EXIT THEN
|
|
|
|
2DUP > IF DUP pos! SWAP THEN
|
|
|
|
( p1 p2, p1 < p2 ) OVER - ( pos len ) FBUF _zbuf
|
|
|
|
SWAP _cpos FBUF ( len src dst ) ROT MOVE ;
|
2020-06-06 21:01:35 -04:00
|
|
|
: $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' = ;
|