Slight completion algorithm tweak
parent
2b70b79874
commit
dfef2d2ad8
|
@ -3,12 +3,8 @@
|
||||||
- "ker" C+u: for a moment, full vocab list is shown
|
- "ker" C+u: for a moment, full vocab list is shown
|
||||||
- some module operations don't work on module-links
|
- some module operations don't work on module-links
|
||||||
- list operations: what if nothing is selected?
|
- list operations: what if nothing is selected?
|
||||||
- list usability
|
|
||||||
- popup: -- close button
|
|
||||||
- popup: -- pin button
|
|
||||||
- modules: core/ libs/ apps/
|
- modules: core/ libs/ apps/
|
||||||
- top level window positioning on ms windows
|
- top level window positioning on ms windows
|
||||||
- completion is not ideal: eg, C+e "buttons"
|
|
||||||
- crashes:
|
- crashes:
|
||||||
- windows gcc issue
|
- windows gcc issue
|
||||||
- robustify stepper -- see if step back past a throw works
|
- robustify stepper -- see if step back past a throw works
|
||||||
|
|
|
@ -55,9 +55,16 @@ USING: kernel arrays sequences math namespaces strings io ;
|
||||||
[ first < ] subset-with
|
[ first < ] subset-with
|
||||||
[ second ] map ;
|
[ second ] map ;
|
||||||
|
|
||||||
|
: complete ( full short -- score )
|
||||||
|
#! Match forwards and backwards, see which one has the
|
||||||
|
#! highest score.
|
||||||
|
[ dupd fuzzy score ] 2keep
|
||||||
|
[ <reversed> ] 2apply
|
||||||
|
dupd fuzzy score max ;
|
||||||
|
|
||||||
: completion ( str quot obj -- pair )
|
: completion ( str quot obj -- pair )
|
||||||
#! pair is { obj score }
|
#! pair is { obj score }
|
||||||
[ swap call dup rot fuzzy score ] keep 2array ; inline
|
[ swap call swap complete ] keep 2array ; inline
|
||||||
|
|
||||||
: completions ( str quot candidates -- seq )
|
: completions ( str quot candidates -- seq )
|
||||||
pick empty? [
|
pick empty? [
|
||||||
|
|
Loading…
Reference in New Issue