branch: master
commit 663f68bf66584782a0f2987651ba25892283616c
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-completion-in-region): Fix compile warning
---
ivy.el | 66 ++++++++++++++++++++++++++++++++----------------------------------
1 file changed, 32 insertions(+), 34 deletions(-)
diff --git a/ivy.el b/ivy.el
index c793317..376c4b4 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2007,40 +2007,38 @@ See `completion-in-region' for further information."
'(ivy-completion-in-region (lambda nil)))))
(if (null comps)
(message "No matches")
- (let ((len (min (ivy-completion-common-length (car comps))
- (length str))))
- (nconc comps nil)
- (delete-region start end)
- (setq ivy-completion-beg start)
- (setq ivy-completion-end start)
- (if (null (cdr comps))
- (if (string= str (car comps))
- (message "Sole match")
- (unless (minibuffer-window-active-p (selected-window))
- (setf (ivy-state-window ivy-last) (selected-window)))
- (ivy-completion-in-region-action
- (substring-no-properties
- (car comps))))
- (let* ((w (1+ (floor (log (length comps) 10))))
- (ivy-count-format (if (string= ivy-count-format "")
- ivy-count-format
- (format "%%-%dd " w)))
- (prompt (format "(%s): " str)))
- (and
- (ivy-read (if (string= ivy-count-format "")
- prompt
- (replace-regexp-in-string "%" "%%" prompt))
- ;; remove 'completions-first-difference face
- (mapcar #'substring-no-properties comps)
- :predicate predicate
- :initial-input str
- :action #'ivy-completion-in-region-action
- :unwind (lambda ()
- (unless (eq ivy-exit 'done)
- (goto-char start)
- (insert str)))
- :caller 'ivy-completion-in-region)
- t)))))))
+ (nconc comps nil)
+ (delete-region start end)
+ (setq ivy-completion-beg start)
+ (setq ivy-completion-end start)
+ (if (null (cdr comps))
+ (if (string= str (car comps))
+ (message "Sole match")
+ (unless (minibuffer-window-active-p (selected-window))
+ (setf (ivy-state-window ivy-last) (selected-window)))
+ (ivy-completion-in-region-action
+ (substring-no-properties
+ (car comps))))
+ (let* ((w (1+ (floor (log (length comps) 10))))
+ (ivy-count-format (if (string= ivy-count-format "")
+ ivy-count-format
+ (format "%%-%dd " w)))
+ (prompt (format "(%s): " str)))
+ (and
+ (ivy-read (if (string= ivy-count-format "")
+ prompt
+ (replace-regexp-in-string "%" "%%" prompt))
+ ;; remove 'completions-first-difference face
+ (mapcar #'substring-no-properties comps)
+ :predicate predicate
+ :initial-input str
+ :action #'ivy-completion-in-region-action
+ :unwind (lambda ()
+ (unless (eq ivy-exit 'done)
+ (goto-char start)
+ (insert str)))
+ :caller 'ivy-completion-in-region)
+ t))))))
(defcustom ivy-do-completion-in-region t
"When non-nil `ivy-mode' will set `completion-in-region-function'."