From 3150bb7c990d276a3d91e70a4342b8789649309b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 7 Dec 2016 00:58:56 -0500 Subject: [PATCH] ivy: update doom*counsel-ag-function advice to reflect upstream changes --- core/defuns/defuns-ivy.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/defuns/defuns-ivy.el b/core/defuns/defuns-ivy.el index 51e88d22d..29da7bfb5 100644 --- a/core/defuns/defuns-ivy.el +++ b/core/defuns/defuns-ivy.el @@ -109,7 +109,7 @@ DIR specifies the default-directory from which ag is run." (counsel-ag " (TODO|FIXME|NOTE) " (doom/project-root))) ;;;###autoload -(defun doom*counsel-ag-function (string extra-ag-args) +(defun doom*counsel-ag-function (string base-cmd extra-ag-args) "Advice to get rid of the character limit from `counsel-ag-function', which interferes with my custom :ag ex command `doom:ivy-ag-search'." (when (null extra-ag-args) @@ -120,12 +120,14 @@ interferes with my custom :ag ex command `doom:ivy-ag-search'." (regex (counsel-unquote-regex-parens (setq ivy--old-re (ivy--regex string))))) - (let ((ag-cmd (format counsel-ag-base-command + (let ((ag-cmd (format base-cmd (concat extra-ag-args " -- " (shell-quote-argument regex))))) - (counsel--async-command ag-cmd)) - nil))) + (if (file-remote-p default-directory) + (split-string (shell-command-to-string ag-cmd) "\n" t) + (counsel--async-command ag-cmd) + nil))))) ;;;###autoload (defun doom/counsel-ag-occur ()