cosmicexplorer / helm-rg

ripgrep is nice
GNU General Public License v3.0
101 stars 21 forks source link

helm-rg total candidate number #22

Closed manuel-uberti closed 4 years ago

manuel-uberti commented 4 years ago

Hi,

first of all thanks for this package. I am using latest helm and latest helm-rg from MELPA, and I'd like to display the total number of candidates of a Helm buffer in my mode-line. I have rewritten helm-show-candidate-number to do this:

(propertize (format " %d/%d"
                    (helm-candidate-number-at-point)
                    (helm-get-candidate-number t))
            'face 'helm-visible-mark)

And this is working with the likes of helm-M-x, helm-find-files, and helm-ls-git-ls. The problem is that the count is always wrong for a helm-rg buffer, meaning it always displays a number ((helm-candidate-number-at-point)) greater than the actual candidate count ((helm-get-candidate-number t)).

Any idea?

If you need me to provide more details or do more tests, just ask of course. :)

manuel-uberti commented 4 years ago

I see that in helm-rg-process-source, :candidate-number-limit is commented out. Any particular reason for this choice?

manuel-uberti commented 4 years ago

Another interesting thing I noticed is that in the helm-rg buffer, (helm-candidate-number-at-point) starts with a value of 2 instead of 1.

Screenshot from 2020-02-01 19-24-16

manuel-uberti commented 4 years ago

Might be useful even if a bit old now: https://github.com/emacs-helm/helm/issues/787#issuecomment-68468083

manuel-uberti commented 4 years ago

I resort to display only helm-candidate-number-at-point in my mode-line, so I'm closing this.