Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
counsel-git-grep-occur - Lisp error #1225
The following stopped working for me:
I fixed the issue for me like so, however, I'm not sure if this is a proper fix:
git diff -U14 diff --git a/counsel.el b/counsel.el index 2a3b10e..9c5cfa5 100644 --- a/counsel.el +++ b/counsel.el @@ -1341,34 +1341,34 @@ If NO-ASYNC is non-nil, do it synchronously instead." (defun counsel-git-grep-occur () "Generate a custom occur buffer for `counsel-git-grep'. When REVERT is non-nil, regenerate the current *ivy-occur* buffer." (unless (eq major-mode 'ivy-occur-grep-mode) (ivy-occur-grep-mode) (setq default-directory counsel--git-dir)) (setq ivy-text (and (string-match "\"\\(.*\\)\"" (buffer-name)) (match-string 1 (buffer-name)))) (let* ((regex (funcall ivy--regex-function ivy-text)) (positive-pattern (replace-regexp-in-string ;; git-grep can't handle .*? "\\.\\*\\?" ".*" (if (stringp regex) regex (caar regex)))) - (negative-patterns - (mapconcat (lambda (x) - (and (null (cdr x)) - (format "| grep -v %s" (car x)))) - regex - " ")) + (negative-patterns (if (stringp regex) "" + (mapconcat (lambda (x) + (and (null (cdr x)) + (format "| grep -v %s" (car x)))) + regex + " ")))
The error seems to be caused by the fact that the regex is a string, but the code expects it to be some other structure.
This is the stack trace that I get without the above patch: