]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/minibuffer.el: Don't return a boundary outside its arg
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 4 Dec 2021 05:02:01 +0000 (00:02 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 4 Dec 2021 05:02:31 +0000 (00:02 -0500)
* 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

index c2a6b01fc8ef0ab41db36d0b1ab0c0fed1b0e75a..0a5fb72774b2412157e163baaa9d6de34af5173b 100644 (file)
@@ -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)