diff options
Diffstat (limited to 'helm-fd.el')
-rw-r--r-- | helm-fd.el | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -1,6 +1,6 @@ ;;; helm-fd.el --- helm interface for fd command line tool. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2019 Thierry Volpiatto <thierry.volpiatto@gmail.com> +;; Copyright (C) 2012 ~ 2020 Thierry Volpiatto <thierry.volpiatto@gmail.com> ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -17,10 +17,13 @@ ;;; Code: +(require 'helm) +(require 'helm-types) + (defvar helm-fd-executable "fd" "The fd shell command executable.") -(defcustom helm-fd-switches '("--hidden" "--type" "f" "--type" "d" "--color" "always") +(defcustom helm-fd-switches '("--no-ignore" "--hidden" "--type" "f" "--type" "d" "--color" "always") "A list of options to pass to fd shell command." :type '(repeat string) :group 'helm-files) @@ -74,9 +77,13 @@ "Initialize fd process in an helm async source." (let* (process-connection-type (cmd (append helm-fd-switches (split-string helm-pattern " "))) - (proc (apply #'start-process "fd" nil "fd" cmd)) - (start-time (float-time))) + (proc (apply #'start-process "fd" nil helm-fd-executable cmd)) + (start-time (float-time)) + (fd-version (replace-regexp-in-string + "\n" "" + (shell-command-to-string (concat helm-fd-executable " --version"))))) (helm-log "Fd command:\nfd %s" (mapconcat 'identity cmd " ")) + (helm-log "VERSION: %s" fd-version) (prog1 proc (set-process-sentinel @@ -88,7 +95,8 @@ (:eval (format "L%s" (helm-candidate-number-at-point))) " " (:eval (propertize (format - "[fd process finished in %.2fs - (%s results)] " + "[%s process finished in %.2fs - (%s results)] " + ,fd-version ,(- (float-time) start-time) (helm-get-candidate-number)) 'face 'helm-fd-finish)))) @@ -115,10 +123,4 @@ (provide 'helm-fd) -;; Local Variables: -;; byte-compile-warnings: (not obsolete) -;; coding: utf-8 -;; indent-tabs-mode: nil -;; End: - ;;; helm-fd.el ends here |