Skip to content
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

fix: gui - highlight opcodes when selecting source #1513

Merged

Conversation

kacperzuk
Copy link
Contributor

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 the pcMap with a term frame._label in v["path"]. v["path"] here is an integer index, while frame._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

  • [N] I have confirmed that my PR passes all linting checks - No, I'm getting mypy issues unrelated to my changes.
  • [N] I have included test cases - No, this it not a new feature, it's a fix.
  • [N] I have updated the documentation - ditto.
  • [N] I have added an entry to the changelog. - No, what's the guideline here? It's not described in CONTRIBUTING.md

@iamdefinitelyahuman iamdefinitelyahuman merged commit a1a5c02 into eth-brownie:master May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants