emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 284cc24: * lisp/minibuffer.el: Don't return a boundary outside it


From: Stefan Monnier
Subject: master 284cc24: * lisp/minibuffer.el: Don't return a boundary outside its arg
Date: Sat, 4 Dec 2021 00:02:37 -0500 (EST)

branch: master
commit 284cc2491d0997e0b6559a2cdefbfed707a259d6
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/minibuffer.el: Don't return a boundary outside its arg
    
    * lisp/minibuffer.el (completion-table-subvert): Fix out of string
    start boundary for the odd case where `string` is shorter than `s1`.
---
 lisp/minibuffer.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index c2a6b01..0a5fb72 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -283,7 +283,7 @@ the form (concat S2 S)."
          ((eq (car-safe action) 'boundaries)
           (let ((beg (or (and (eq (car-safe res) 'boundaries) (cadr res)) 0)))
             `(boundaries
-              ,(max (length s1)
+              ,(max (min (length string) (length s1))
                     (+ beg (- (length s1) (length s2))))
               . ,(and (eq (car-safe res) 'boundaries) (cddr res)))))
          ((stringp res)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]