Fix INITIAL-INPUT cons handling in ido-read-internal

* lisp/ido.el (ido-read-internal): Is INITIAL-INPUT is a cons that
specifies cursor position, adjust the number to be palatable for
`read-for-minibuffer' (bug#27807).
This commit is contained in:
Lars Ingebrigtsen 2019-07-15 20:52:48 +02:00
parent 93e1f7c66f
commit b7fcfc6412

View file

@ -1905,7 +1905,14 @@ If INITIAL is non-nil, it specifies the initial input string."
)
(ido-setup-completion-map)
(setq ido-text-init initial)
(setq ido-text-init
(if (consp initial)
(cons (car initial)
;; `completing-read' uses 0-based index while
;; `read-from-minibuffer' uses 1-based index.
(1+ (cdr initial)))
initial))
(setq ido-input-stack nil)
(run-hooks 'ido-setup-hook)