branch: externals/corfu
commit 026ce5c505d3f84fd298962e709b0ec7c210bc58
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>
    Minor highlighting workaround
---
 corfu.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/corfu.el b/corfu.el
index ef403f7..2f58387 100644
--- a/corfu.el
+++ b/corfu.el
@@ -343,7 +343,12 @@ Set to nil in order to disable confirmation."
                 (and cands (nconc cands base))))
              ((symbol-function #'completion-pcm--hilit-commonality)
               (lambda (pattern cands)
-                (setq hl (lambda (x) (completion-pcm--hilit-commonality 
pattern x)))
+                (setq hl (lambda (x)
+                           ;; `completion-pcm--hilit-commonality' sometimes 
throws an internal error
+                           ;; for example when entering "/sudo:://u".
+                           (condition-case nil
+                               (completion-pcm--hilit-commonality pattern x)
+                             (t x))))
                 cands))
              ((symbol-function #'orderless-highlight-matches)
               (lambda (pattern cands)

Reply via email to