1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 22:18:07 +11:00
collapseos/blk/107
Virgil Dupras 64ce8ab3e9 ed: Improve F with repeated searches
Make F search from curpos+1 so that it's possible to search the
same word we've just found a second time. Previously, it would find
the word under the cursor.

Also, improve docs a bit.
2020-06-09 21:17:08 -04:00

11 lines
385 B
Plaintext

: _F ( F without _type and _pln. used in VE )
FBUF EDPOS @ _cpos 1+ ( a1 a2 )
BEGIN
C@+ ROT ( a2+1 c2 a1 ) C@+ ROT ( a2+1 a1+1 c1 c2 )
= NOT IF DROP FBUF THEN ( a2 a1 )
TUCK C@ 0xd = ( a1 a2 f1 )
OVER BLK) = OR ( a1 a2 f1|f2 )
UNTIL ( a1 a2 )
DUP BLK) < IF BLK( - FBUF + -^ EDPOS ! ELSE DROP THEN ;
: F FBUF _type _F EDPOS @ 64 / _pln ;