"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
(transformer-fn
(plist-get ivy--display-transformers-list
(or caller (and (functionp collection)
- collection))))
- (original-action (and (consp action)
- (copy-sequence action))))
+ collection)))))
(setq ivy-last
(make-ivy-state
:prompt prompt
(when recursive-ivy-last
(ivy--reset-state (setq ivy-last recursive-ivy-last)))))
(ivy-call)
- (when original-action
- (setf (ivy-state-action ivy-last) original-action))
(when (and recursive-ivy-last
ivy-recursive-restore)
(ivy--reset-state (setq ivy-last recursive-ivy-last))))))
(set (make-local-variable 'minibuffer-default-add-function)
(lambda ()
(list ivy--default)))
+ (set (make-local-variable 'inhibit-field-text-motion) nil)
(when (display-graphic-p)
(setq truncate-lines t))
(setq-local max-mini-window-height ivy-height)