* 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`.
This commit is contained in:
Stefan Monnier 2021-12-04 00:02:01 -05:00
parent 644dd2f050
commit 284cc2491d

View 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)