Yevgnen / ivy-rich

More friendly interface for ivy.
363 stars 37 forks source link

Fuzzy match matches helper messages #49

Open kurnevsky opened 5 years ago

kurnevsky commented 5 years ago

See the screenshot where the matching for 't' and 's' letters is displayed (with ivy--regex-fuzzy):

screenshot-2019-03-01-23 04 38

kurnevsky commented 5 years ago

Can be fixed with a dirty hack:

(advice-add 'ivy--highlight-fuzzy :around (lambda (orig-fun &rest args)
                                            (let* ((cols (split-string (car args) (char-to-string #x200B)))
                                                    (res (apply orig-fun (list (car cols)))))
                                              (mapconcat 'identity (cons res (cdr cols)) ""))))

(advice-add 'ivy-rich-normailze-width :around (lambda (orig-fun &rest args)
                                                (pcase args
                                                  (`(,str ,len ,left)
                                                    (apply orig-fun (list (concat str (char-to-string #x200B)) (1+ len) left))))))
Yevgnen commented 5 years ago

Sorry for late reply and I currently can not find a elegant fix to this...

kurnevsky commented 5 years ago

Reported to ivy repo because it happens with counsel as well: https://github.com/abo-abo/swiper/issues/1969