Bug 397272 - Find Tool does not show total number of matches or current match number
Summary: Find Tool does not show total number of matches or current match number
Status: REPORTED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: 18.04.3
Platform: Neon Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 426298 448236 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-08 14:10 UTC by Greg Lepore
Modified: 2024-11-19 10:56 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
attachment-999651-0.html (204 bytes, text/html)
2024-11-19 08:05 UTC, Justin Zobel
Details
attachment-1026703-0.html (149 bytes, text/html)
2024-11-19 10:56 UTC, Justin Zobel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Lepore 2018-08-08 14:10:24 UTC
When using the search feature in Kate it would be very helpful for Kate to show the total number of matches found as well as the current number of the highlighted match.
Comment 1 Ahmad Samir 2019-06-23 12:33:04 UTC
If you meant the default search bar in kate, you can already see the total number of matches by using the "Find all" button; you'll have to switch to the advanced search bar, the shortcut if Ctrl+R or by clicking the relevant button on the search bar.

As for showing the current match number, I suggest you try setting kate to show the line numbers, IMHO that's more indicative of where a particular match is located in a file, YMMV.
Comment 2 bronko 2020-01-25 22:09:13 UTC
Thank you for pointing out the advanced search bar. 
IMHO the popup message should also be used on a Ctrl+F search and include the current match number (i.e. "match 1 of 5").
The popup should be shown every time when using the next/previous match button.
Comment 3 Eduardo 2021-11-25 16:22:37 UTC
I was about to open a feature request for this but found it already existed.

I'm all for this, it is something I've missed since I started using KDE software.

We can take Firefox's "CTRL+F" search bar as a reference. It shows a label like "1 of 12 matches" in the very search bar itself.

I understand there is the "Find all" feature in Kate, but that's not the same thing. What we are requesting here is really just that label on the small & quick CTRL+F bar. I really helps to organize thoughts when editing any kind of text/code/config/script file.
Comment 4 Ahmad Samir 2021-11-25 16:26:24 UTC
Right, actually the code should already have the number of matches since we have to find the matches to show the scrollbar marks anyway.
Comment 5 Waqar Ahmed 2021-11-25 16:27:56 UTC
There's also the search plugin which has a lot more features including the one you requested. Press Ctrl+shift+F to open it and set the mode to Current File.
Comment 6 Waqar Ahmed 2022-01-11 06:15:50 UTC
*** Bug 448236 has been marked as a duplicate of this bug. ***
Comment 7 Waqar Ahmed 2022-01-14 20:14:56 UTC
*** Bug 426298 has been marked as a duplicate of this bug. ***
Comment 8 Waqar Ahmed 2024-11-19 07:50:45 UTC
I think this is out of scope for Ctrl + F. Firstly, the UI space is limited in Ctrl+F. Also, to find the total no of matches, we have to find all the matches. Ctrl+F works differently, it just stops on first match. We can do this for Ctrl+R though,
Comment 9 Justin Zobel 2024-11-19 08:05:30 UTC
Created attachment 175942 [details]
attachment-999651-0.html

I've seen other UIs be able to show it for Ctrl + F. I'll try to have a look tonight to find some examples and where we can show it for Kate.
Comment 10 Grósz Dániel 2024-11-19 08:40:55 UTC
(In reply to Waqar Ahmed from comment #8)
> I think this is out of scope for Ctrl + F. Firstly, the UI space is limited
> in Ctrl+F. Also, to find the total no of matches, we have to find all the
> matches. Ctrl+F works differently, it just stops on first match. We can do
> this for Ctrl+R though,

There is plenty of horizontal space. With Ctrl+R there's also unused space at the bottom between the settings and the next/previous buttons.

Most programs these days with some find-in-content functionality show the total number of matches and the index of the current match, and highlight all matches, continuously as you type, without having to click specific buttons buttons. There's no need to automatically ape other programs, but I think this is a case where the nowadays popular UI gets it right and has a convenience benefit with no disadvantage (except I guess if counting all results in a really big file is done in the foreground).
Comment 11 Waqar Ahmed 2024-11-19 09:33:10 UTC
> except I guess if counting all results in a really big file is done in the foreground

That part is a little bit important, I routinely use Kate on huge log files 150MB-1GB. I want instant results.
Comment 12 Grósz Dániel 2024-11-19 10:35:27 UTC
(In reply to Waqar Ahmed from comment #11)
> > except I guess if counting all results in a really big file is done in the foreground
> 
> That part is a little bit important, I routinely use Kate on huge log files
> 150MB-1GB. I want instant results.

Hmm, I thought Kate wasn't very usable with files bigger than a few megabytes anyway, though perhaps that's just if they don't have line breaks (most of the time I open huge files are when I accidentally open a minified js or something like that).

Anyway you could just limit the feature based on file size or time taken. Or do it in the background like less does, though I imagine that can get complicated.
Comment 13 Justin Zobel 2024-11-19 10:56:46 UTC
Created attachment 175947 [details]
attachment-1026703-0.html

And Kate can have a sane default of not doing the count on files over x MB or y lines.