Repository navigation
rust-explorer: typing a name in the list selects the matching row (#130) - #167
Open
GuilhermeProvenci wants to merge 1 commit into
Open
GuilhermeProvenci wants to merge 1 commit into
GuilhermeProvenci wants to merge 1 commit into
Conversation
…mxy#130) The folder list is virtual (LVS_OWNERDATA), so the list view has no items of its own to search and asks the parent with LVN_ODFINDITEM. Nothing answered, and every typed letter landed on the first row. find_row answers it: the first row at or after the current one whose name starts with what was typed, case ignored, wrapping round to the top; the date-group heading rows never match. -1 (no match) leaves the selection where it is. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #130.
Problem. In the file manager, typing the start of a name does not go to that item: every letter lands on the first row.
Cause. The folder list is a virtual list view (
LVS_OWNERDATA), so the control has no items of its own to search. It asks its parent withLVN_ODFINDITEM, and nothing answered it, so the answer was always row 0.Fix.
find_rowanswers the notification: the first row at or after the current one whose name begins with what was typed, case ignored, wrapping round to the top. The date-group heading rows (Group by date) never match. No match returns -1, so the selection stays where it is.Test.
cargo test -p rust-explorer(newtyping_a_name_finds_the_row_not_the_first_one: first letter, case, start row and wrap, accents, no match, empty, stale start row). By hand: open a folder, type the first letters of a name; typing quickly keeps extending the prefix (the list view does that).I have not tested the desktop view (it is not virtual and the list view handles it itself) or a folder with thousands of rows.
🤖 Generated with Claude Code