fix: gui - highlight opcodes when selecting source #1513
Merged
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.
What I did
Selecting any text just causes the selection to disappear, instead of highlighting relevant opcodes. This PR fixes this.
Related PR: #1512
How I did it
After releasing a button,
SourceNoteBook._search()
is triggered to find opcodes related to given source code. When searching for opcodes, it filters thepcMap
with a termframe._label in v["path"]
.v["path"]
here is an integer index, whileframe._label
is a string path to the source file. As this compares apples-to-oranges, it always evaluates to false and triggers the code branch that clears selection.In this PR I've changed the term to compare label to label.
How to verify it
I believe GUI has no tests, so you need to run it manually and select some source code.
Checklist