Fix "failed" error from +helm/ag{,-from-cwd} #644
Only affected Ag backend.
This commit is contained in:
parent
e4e2fb55ed
commit
641425ab77
1 changed files with 15 additions and 11 deletions
|
@ -18,6 +18,7 @@
|
||||||
(directory (or in project-root))
|
(directory (or in project-root))
|
||||||
(default-directory directory)
|
(default-directory directory)
|
||||||
(helm-ag--default-directory directory)
|
(helm-ag--default-directory directory)
|
||||||
|
(helm-ag--default-target (list directory))
|
||||||
(engine (or engine
|
(engine (or engine
|
||||||
(and (executable-find "rg") 'rg)
|
(and (executable-find "rg") 'rg)
|
||||||
(and (executable-find "ag") 'ag)
|
(and (executable-find "ag") 'ag)
|
||||||
|
@ -61,7 +62,6 @@
|
||||||
(if recursive " -R" "")
|
(if recursive " -R" "")
|
||||||
(if recursive "." "./*"))))
|
(if recursive "." "./*"))))
|
||||||
(helm-grep-default-recurse-command helm-grep-default-command))
|
(helm-grep-default-recurse-command helm-grep-default-command))
|
||||||
(message "-- %s (%s)" helm-grep-default-command query)
|
|
||||||
(setq helm-source-grep
|
(setq helm-source-grep
|
||||||
(helm-build-async-source (capitalize (helm-grep-command t))
|
(helm-build-async-source (capitalize (helm-grep-command t))
|
||||||
:header-name (lambda (_name) "Helm Projectile Grep (C-c ? Help)")
|
:header-name (lambda (_name) "Helm Projectile Grep (C-c ? Help)")
|
||||||
|
@ -85,7 +85,8 @@
|
||||||
:truncate-lines helm-grep-truncate-lines))
|
:truncate-lines helm-grep-truncate-lines))
|
||||||
(cl-return t))
|
(cl-return t))
|
||||||
(`ag
|
(`ag
|
||||||
(list "ag -zS --nocolor --nogroup"
|
(list "ag -zS"
|
||||||
|
(if IS-WINDOWS "--vimgrep" "--nocolor --nogroup")
|
||||||
(when all-files "-a")
|
(when all-files "-a")
|
||||||
(unless recursive "--depth 1")))
|
(unless recursive "--depth 1")))
|
||||||
(`rg
|
(`rg
|
||||||
|
@ -97,15 +98,18 @@
|
||||||
(when all-files "-a")
|
(when all-files "-a")
|
||||||
(unless recursive "--depth 1")))))
|
(unless recursive "--depth 1")))))
|
||||||
(helm-ag-base-command (string-join command " ")))
|
(helm-ag-base-command (string-join command " ")))
|
||||||
(setq helm-ag--last-query query)
|
(if (and (eq engine 'ag)
|
||||||
(helm-attrset 'search-this-file nil helm-ag-source)
|
(equal query ""))
|
||||||
(helm-attrset 'name (helm-ag--helm-header helm-ag--default-directory) helm-ag-source)
|
(helm-do-ag directory)
|
||||||
(helm :sources '(helm-ag-source)
|
(setq helm-ag--last-query query)
|
||||||
:input query
|
(helm-attrset 'search-this-file nil helm-ag-source)
|
||||||
:prompt prompt
|
(helm-attrset 'name (helm-ag--helm-header helm-ag--default-directory) helm-ag-source)
|
||||||
:buffer "*helm-ag*"
|
(helm :sources '(helm-ag-source)
|
||||||
:keymap helm-ag-map
|
:input query
|
||||||
:history 'helm-ag--helm-history)))
|
:prompt prompt
|
||||||
|
:buffer "*helm-ag*"
|
||||||
|
:keymap helm-ag-map
|
||||||
|
:history 'helm-ag--helm-history))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +helm/project-search (arg)
|
(defun +helm/project-search (arg)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue