From 284cc2491d0997e0b6559a2cdefbfed707a259d6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 4 Dec 2021 00:02:01 -0500 Subject: [PATCH] * 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 c2a6b01fc8e..0a5fb72774b 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) -- 2.39.5