feat(search): highlight the current match in its own color #53
Merged
BlackAngelTV
merged 2 commits from 2026-12-03 10:06:07 +01:00
feat/search-current-match into main
No Reviewers
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: FWS/FWS-Kitty#53
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
All occurrences of an in-place scrollback search were highlighted identically, so the current match could only be found through the
[current/total]counter in the window title.The current match now uses the second mark color (
mark2_*) while the other matches keep the first one, and the marker is rebuilt on everyn/Njump.Escapestill restores the previous marker.Changes
kitty/scrollback_search.py:ScrollbackSearch.current_matchandmarker_spans(), which groups the spans by line text and colors the current one.kitty/marks.py:marker_from_spans()avoids re-running the query for every line.kitty/window.py: the search marker is built from the spans and refreshed when the index moves.docs/basic.rst,docs/changelog.rstand the action help describe the two colors.Marker functions are called once per line without its number, so the lookup is done by line text; identical lines are highlighted alike, which is indistinguishable on screen.
Tests
python3 -m unittest kitty_tests.scrollback_search(index tracking, colors, wrapping)ruff check/ruff format --checkFixes #51