aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2020-12-29 13:31:46 +0000
committerJoão Távora2020-12-29 13:31:46 +0000
commit03c160fb1573107586355e851c111326debfe95a (patch)
tree38c364d6eea742bb2a94666bdbdef342e730561a
parentd8c596f7309bd6fd6e127b8027dfb4c508afd2ea (diff)
downloademacs-scratch/bug-42149-funny-pcm-completion-scores.tar.gz
emacs-scratch/bug-42149-funny-pcm-completion-scores.zip
Fix "first-differente" face in completion-pcm--hilit-commonalityscratch/bug-42149-funny-pcm-completion-scores
Fixes: bug#42149 Depending on the position of point in the completion and the completion style being used, it may or may not make sense for this face to appear immediately after point. This patch assumes that it should appear in the first non-matched character after point, which may likely be the next one to type to disambiguate between two or more completions. Suggested by Dario Gjorgjevski <dario.gjorgjevski@gmail.com>. * lisp/minibuffer.el (completion-pcm--hilit-commonality): Fix occasional misplacement of completions-first-differente.
-rw-r--r--lisp/minibuffer.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index dc37c5f4476..074d436b355 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3332,11 +3332,12 @@ between 0 and 1, and with faces `completions-common-part',
3332 ;; for that extra bit of match (bug#42149). 3332 ;; for that extra bit of match (bug#42149).
3333 (unless (= from match-end) 3333 (unless (= from match-end)
3334 (funcall update-score-and-face from match-end)) 3334 (funcall update-score-and-face from match-end))
3335 (if (> (length str) pos) 3335 (cl-loop for p from pos below (length str)
3336 (add-face-text-property 3336 unless (eq (get-text-property p 'face str)
3337 pos (1+ pos) 3337 'completions-common-part)
3338 'completions-first-difference 3338 return (add-face-text-property p (1+ p)
3339 nil str)) 3339 'completions-first-difference
3340 nil str))
3340 (unless (zerop (length str)) 3341 (unless (zerop (length str))
3341 (put-text-property 3342 (put-text-property
3342 0 1 'completion-score 3343 0 1 'completion-score