Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add selection to file-name-history #158

Merged
merged 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 17, 2012
  1. add selection to file-name-history

    Le Wang authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 helm-files.el
View
9 helm-files.el
@@ -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)
Something went wrong with that request. Please try again.