mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 23:48:05 +11:00
b22ab8437b
Kinda proud of this one. Efficiently piggy-backing on the Block Editor, keeping things simple, and yet, building power into the editor.
14 lines
471 B
Plaintext
14 lines
471 B
Plaintext
: $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 ;
|
|
: $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' = ;
|