-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Find navigator improvements #678
Find navigator improvements #678
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (not able to test the code ATM)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running this I'm getting a crash Swift/UnsafeBufferPointer.swift:898: Fatal error
when there's a ton of results (eg searching "hi" and returning a whole ton of files).
Along with the crash it's also giving me the error
the ID Optional("--") occurs multiple times within the collection, this will give undefined results!
In a ForEach body.
I think it's just that the ID for each search result needs to be unique but right now it's using the value of the result's string.
… this will give undefined results!`
Turns out that this was an error in one of the files that I hadn't even touched in my PR (CodeEdit/NavigatorSidebar/FindNavigator/FindNavigatorResultFileItem.swift), and somehow the changes that I made allowed those errors to pop up. Making the ID reliant on the whole class instead of just the display name solved the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
What's been implemented:
File specific changes:
selectedMode
fromFindNavigatorModeSelector
to hereignoreCase
booleansearch
function for clarity (replacingif let
s withguard let
s, etc to avoid too many ifs in ifs)lineContainsSearchTerm
to contain regex, containing term, matching/starting/ending word checksSearchState
reference (the mode selector now edits this instead of its own local versionselectedMode
so that it updates thestate
on setgetAllModes
function (thechildren
property can be used instead)Related Issue
Checklist
Screenshots
The broken UI (adding spacers doesn't help push the text to the right side):now fixedold: