Bug 509048 - Trim the white-space before a search mach output to improve match visibility
Summary: Trim the white-space before a search mach output to improve match visibility
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (other bugs)
Version First Reported In: 23.08.5
Platform: Kubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-03 03:23 UTC by Bill in KCMO
Modified: 2025-10-04 19:26 UTC (History)
2 users (show)

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


Attachments
Including indents in search results pushes the results too far to the right. (75.25 KB, image/png)
2025-09-03 03:23 UTC, Bill in KCMO
Details
Better to omit indentation so that all results can be seen (89.32 KB, image/png)
2025-09-03 03:24 UTC, Bill in KCMO
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bill in KCMO 2025-09-03 03:23:28 UTC
Created attachment 184655 [details]
Including indents in search results pushes the results too far to the right.

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY


STEPS TO REPRODUCE
Shift+Ctrl+F
Enter search term and press enter

OBSERVED RESULT
The search results include indentation, and hides some of the results too far to the right

EXPECTED RESULT
Search results should not include indentation: the user is searching for terms, not indents.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 22.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13

ADDITIONAL INFORMATION
See attached pictures for issue and suggested solution
Comment 1 Bill in KCMO 2025-09-03 03:24:20 UTC
Created attachment 184656 [details]
Better to omit indentation so that all results can be seen
Comment 2 Kåre Särs 2025-09-03 07:15:53 UTC
Thanks for the report.

I turned this into a wish. It is a good improvement suggestion!

Sometimes the indentation can have some value, so a blanket remove all leading white-space might not be desired. The target should definitely be to get the match to always be visible. This needs some tweaking.
Comment 3 Allen Winter 2025-09-30 13:19:19 UTC
as a follow-on to this, someone just asked about tab widths in the search results.
https://discuss.kde.org/t/size-of-tab-in-katesearch-and-diff-plugin/40155

not quite the same thing but
related in the sense that whitespace handling in the search results might be improved.
Comment 4 Bug Janitor Service 2025-10-02 18:31:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1903
Comment 5 Bug Janitor Service 2025-10-04 15:44:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1906
Comment 6 Christoph Cullmann 2025-10-04 19:26:46 UTC
Git commit 7b3e5ea11a382bc84df9f1070413f432e0918db0 by Christoph Cullmann, on behalf of Kåre Särs.
Committed on 04/10/2025 at 19:19.
Pushed by cullmann into branch 'master'.

S&R: Limit the pre-match part in the results to 25% of view width

If the search tool-view is narrow we don't want too much pre-match
string as the match might not even be visible. So ensure that at most
25% of the tree-view width is occupied by the pre-match part

M  +13   -4    addons/search/SearchResultsDelegate.cpp

https://invent.kde.org/utilities/kate/-/commit/7b3e5ea11a382bc84df9f1070413f432e0918db0