Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show number of total matches [Feature request] #1931

Closed
junnu-github opened this issue Feb 12, 2019 · 9 comments
Closed

show number of total matches [Feature request] #1931

junnu-github opened this issue Feb 12, 2019 · 9 comments

Comments

@junnu-github
Copy link

@junnu-github junnu-github commented Feb 12, 2019

Swiper shows the count of lines which has the matching phrase

for example , contents of buffer

      word1 word2 word3
      word4 word5 word6

when the phrase "word" is searched, the count is shown as 2, since 2 lines has the matching phrase.
It would be nice to have option to customize to show the total match count (in this case its 6)

@basil-conto
Copy link
Collaborator

@basil-conto basil-conto commented Feb 12, 2019

This has also been asked for on Emacs SE: https://emacs.stackexchange.com/q/32371/15748.

I think it's been briefly discussed in another issue as well, but I can't find it at the moment.

@Ergus
Copy link
Contributor

@Ergus Ergus commented Feb 19, 2019

Hi, yes I have been interested in this too. A similar/related functionality is to make swiper progress (go to next match) similar to isearch in case of different matches in the same line to move faster between them.
For example if the user wants to go to the third match of a word (or subword) in a long line that has it many times; right now is a bit faster/easier to use isearch than swiper (same if he wants to go to the previous match and type C-r).
I know there is avy that faces this kind of issues, but sometimes is faster to type C-s regex and C-s a couple of times.
This functionality will require also a different face for the matching pattern within the actual line.

@abo-abo abo-abo closed this in f9b64c3 Apr 3, 2019
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Apr 3, 2019

Thanks. Please test swiper-isearch. It's no longer line-based like swiper, which makes it display the total number of matches. It also fixes the slow startup of swiper.

@Ergus
Copy link
Contributor

@Ergus Ergus commented Apr 3, 2019

Hi:
Yes it works pretty fine for me and probably it will fully replace swiper & isearch (I only need to bind C-r to invert search direction, nothing special).
I know this is too much to ask for, but please remember to update the wiki in order to include all the extra nice fancy new features/options you have added recently.
Once again;
Very thanks

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Apr 3, 2019

You're welcome. The wiki is open for public edits, no pull request process necessary. PRs for documentation are welcome as well.

@Ergus
Copy link
Contributor

@Ergus Ergus commented Apr 3, 2019

Hi Abo-abo:

Is it there any face to change in order to distinguish the current selected candidate from the others in the same line? Because right now when using the isearch-swiper from a terminal emacs there is no way cause the cursor disappears during search and all the line is highlighted.

In graphical emacs the cursor makes the difference, but it could be also useful to have a more verbose difference for the actual candidate like a different face.

Sorry for bothering more :( tell me if you prefer to open a new issue.

abo-abo added a commit that referenced this issue Apr 3, 2019
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Apr 3, 2019

Please test.

@Ergus
Copy link
Contributor

@Ergus Ergus commented Apr 4, 2019

Yes, better now. I would prefer the different face for the whole match, but this way is good enough. It is functional for me as is now.
Once again very thanks

@Lenbok
Copy link

@Lenbok Lenbok commented Apr 14, 2019

@Ergus Could you please show your C-r binding to change search direction?

Edit: found it, in my use-package config I added:

(bind-key "C-r" 'ivy-previous-line-or-history ivy-minibuffer-map)

(I'm not sure why this wasn't already symmetric with the C-s that was already in ivy-minibuffer-map)

astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants