(const :tag "Count matches and show current match" "(%d/%d) ")
string))
+(defcustom ivy-add-newline-after-prompt nil
+ "When non-nil, add a newline after the `ivy-read' prompt."
+ :type 'boolean)
+
(defcustom ivy-wrap nil
"When non-nil, wrap around after the first and the last candidate."
:type 'boolean)
"Return a string that corresponds to the current thing at point."
(or
(thing-at-point 'url)
- (ffap-file-at-point)
+ (and (eq (ivy-state-collection ivy-last) 'read-file-name-internal)
+ (ffap-file-at-point))
(let (s)
(cond ((stringp (setq s (thing-at-point 'symbol)))
(if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
(progn
(insert ivy--default)
(when (and (with-ivy-window (derived-mode-p 'prog-mode))
+ (eq (ivy-state-caller ivy-last) 'swiper)
(not (file-exists-p ivy--default))
(not (ffap-url-p ivy--default))
(not (ivy-state-dynamic-collection ivy-last))
:value-type (choice
(const :tag "Plain sort" string-lessp)
(const :tag "File sort" ivy-sort-file-function-default)
- (const :tag "No sort" nil)))
+ (const :tag "No sort" nil)
+ (function :tag "Custom function")))
:group 'ivy)
(defvar ivy-index-functions-alist
(if (and (setq sort-fn (cdr (assoc t ivy-sort-functions-alist)))
(<= (length coll) ivy-sort-max-size))
(setq coll (cl-sort (copy-sequence coll) sort-fn))))))
+ (setq coll (ivy--set-candidates coll))
(when preselect
(unless (or (and require-match
(not (eq collection 'internal-complete-buffer)))
(window-width))
(setq n-str (concat n-str "\n" d-str))
(setq n-str (concat n-str d-str)))
+ (when ivy-add-newline-after-prompt
+ (setq n-str (concat n-str "\n")))
(let ((regex (format "\\([^\n]\\{%d\\}\\)[^\n]" (window-width))))
(while (string-match regex n-str)
(setq n-str (replace-match (concat (match-string 1 n-str) "\n") nil t n-str 1))))
(cl-incf i))))))
str))
+(ivy-set-display-transformer
+ 'counsel-find-file 'ivy-read-file-transformer)
(ivy-set-display-transformer
'read-file-name-internal 'ivy-read-file-transformer)