]> code.delx.au - gnu-emacs-elpa/commit
`counsel-git-grep' can now handle huge git repos
authorOleh Krehel <ohwoeowho@gmail.com>
Mon, 20 Apr 2015 16:34:43 +0000 (18:34 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Mon, 20 Apr 2015 17:24:00 +0000 (19:24 +0200)
commit294ec7f480908268055b273da96674382b84e198
tree544800d67b73a58ed46b9b14f5a9d0b655c0dc1f
parent55f4dec7b88e27205f82ac66867dfebc36107734
`counsel-git-grep' can now handle huge git repos

* counsel.el (counsel-git-grep-count): Return a number instead of a
  string. Apply `ivy--regex' on the input.
(counsel--git-grep-count): New defvar.
(counsel-git-grep-function): If the repo has >20000 lines, use `head' 5000
instead, but still display the true amount of matches.
(counsel-git-grep): Set `ivy--dynamic-function'.
(counsel-locate-function): Update.

* ivy.el (ivy--dynamic-function): New defvar. When this isn't nil, it
  will be called to get a new batch of candidates in case the `ivy-text'
  was changed.
(ivy--full-length): The true candidates length in case of `head' shenanigans.
(ivy--old-text): Store the old text for when `ivy--dynamic-function' was
called last.
(ivy--insert-prompt): Update.
(ivy--exhibit): Don't do filtering for non-nil `ivy--dynamic-function' -
let the caller (usually a shell tool) do the filtering.
(ivy--insert-minibuffer): New defun, created from a part of
`ivy--exhibit'.
counsel.el
ivy.el