branch: externals/hotfuzz
commit 8b8a13f212ee433f65e1efeca45c5161f0062ee7
Author: Axel Forsman <[email protected]>
Commit: Axel Forsman <[email protected]>

    Highlight the actual optimal positions
    
    If at any point a deletion was optimal, then make sure to delete that
    whole gap.
---
 hotfuzz.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hotfuzz.el b/hotfuzz.el
index 066e1c49f5..59edb2fb1a 100644
--- a/hotfuzz.el
+++ b/hotfuzz.el
@@ -126,9 +126,12 @@ HAYSTACK has to be a match according to `hotfuzz-filter'."
                     finally return res)
        ;; Backtrack to find matching positions
        for j from (1- n) downto 0 with i = m do
-       (while (cl-destructuring-bind (c . d) (pop rows)
-                (cl-decf i)
-                (<= (aref d j) (aref c j))))
+       (when (<= (aref (cdar rows) j) (aref (caar rows) j))
+         (while (cl-destructuring-bind (_c . d) (pop rows)
+                  (cl-decf i)
+                  (and (> i 0) (< (aref (cdar rows) j) (aref d j))))))
+       (pop rows)
+       (cl-decf i)
        (add-face-text-property i (1+ i) 'completions-common-part nil haystack)
        finally return haystack))))
 

Reply via email to