Permalink
Browse files

Merge pull request #158 from lewang/file-name-history-play

add selection to file-name-history
  • Loading branch information...
2 parents cfd8d65 + 1ed71e6 commit b3a0ff01662b1369fa0fb816ce41b31fe1c0a0e8 @thierryvolpiatto thierryvolpiatto committed Nov 17, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 helm-files.el
View
@@ -1436,10 +1436,15 @@ See `helm-ff-transform-fname-for-completion'."
(string-match "\\(?:/\\|\\`\\)\\.\\{1,2\\}\\'" dir))
(defun helm-ff-save-history ()
- "Store the last value of `helm-ff-default-directory' in `helm-ff-history'."
+ "Store the last value of `helm-ff-default-directory' in `helm-ff-history'.
+
+Store the selected file-name in the `file-name-history'."
(when (and helm-ff-default-directory
(helm-file-completion-source-p))
- (push helm-ff-default-directory helm-ff-history)))
+ (push helm-ff-default-directory helm-ff-history)
+ ;; we use `abbreviate-file-name' here because other parts of Emacs seems to,
+ ;; and we don't want to introduce duplicates.
+ (add-to-history 'file-name-history (abbreviate-file-name (helm-get-selection)))))
(add-hook 'helm-cleanup-hook 'helm-ff-save-history)
(defun helm-ff-valid-symlink-p (file)

0 comments on commit b3a0ff0

Please sign in to comment.