Set evil jump point before counsel-ag (and variants)

This commit is contained in:
Henrik Lissner 2018-03-18 15:18:19 -04:00
parent ff0b45299e
commit bf771dcbdb
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 6 additions and 4 deletions

View file

@ -157,14 +157,15 @@ search current file. See `+ivy-task-tags' to customize what this searches for."
;;;###autoload
(defun +ivy*counsel-ag-function (string)
"Advice to 1) get rid of the character limit from `counsel-ag-function' and 2)
disable ivy's over-zealous parentheses quoting behavior (if i want literal
parentheses, I'll escape them myself).
"Advice to get rid of the character limit from `counsel-ag-function' and use
`evil-set-jump' if evil is active.
NOTE This may need to be updated frequently, to meet changes upstream (in
counsel-rg)."
(if (< (length string) 1) ; <-- modified the character limit
(counsel-more-chars 1) ; <--
(when (and (featurep 'evil) evil-mode)
(evil-set-jump))
(let ((default-directory (ivy-state-directory ivy-last))
(regex (counsel-unquote-regex-parens
(setq ivy--old-re

View file

@ -109,7 +109,8 @@ immediately runs it on the current candidate (ending the ivy session)."
cmd
'(("O" +ivy-git-grep-other-window-action "open in other window"))))
;; Removes character limit from `counsel-ag-function'
;; Removes character limit from `counsel-ag-function' and sets a jump point
;; for `evil'.
;;
;; This may need to be updated frequently, to meet changes upstream.
;; counsel-ag, counsel-rg and counsel-pt all use this function