]> code.delx.au - gnu-emacs-elpa/commitdiff
counsel.el (counsel-find-file): Add initial-input
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 5 Jan 2016 15:39:46 +0000 (16:39 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 5 Jan 2016 15:39:46 +0000 (16:39 +0100)
Re #336

counsel.el

index 227ad7f88af1fc5f737e209a88b418794515c8d5..89d310794e78e4b7276b67df45efff49541fd79a 100644 (file)
@@ -460,11 +460,13 @@ INITIAL-INPUT can be given as the initial minibuffer input."
 (defvar counsel-find-file-map (make-sparse-keymap))
 
 ;;;###autoload
-(defun counsel-find-file ()
-  "Forward to `find-file'."
+(defun counsel-find-file (&optional initial-input)
+  "Forward to `find-file'.
+When INITIAL-INPUT is non-nil, use it in the minibuffer during completion."
   (interactive)
   (ivy-read "Find file: " 'read-file-name-internal
             :matcher #'counsel--find-file-matcher
+            :initial-input initial-input
             :action
             (lambda (x)
               (with-ivy-window