Skip to content

fix: resolve stale highlights and settings reload issues #258

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

esthor
Copy link

@esthor esthor commented Mar 11, 2025

This resolves the 2 issues I was encountering, that I think this user was also encountering in this issue: #257

I also wasn't sure if we should keep the comment about the init guarding because it seems more straightforward and safe to just look for the 'enabled' than to check for a negative.

What's Changed:

  • Add proper cleanup of decorations when settings change
  • Clear all decorations before applying new ones
  • Improve handling of extension enable/disable state

- Add proper cleanup of decorations when settings change

- Clear all decorations before applying new ones

- Improve handling of extension enable/disable state
@esthor
Copy link
Author

esthor commented Mar 11, 2025

btw, I also have an easy repro:

  1. go to settings.json
  2. create a new custom todohighlight.keywords entry
  3. toggle back and forth with the text
  4. have a use of that keyword above.
  5. watch it not update the styling (on current production version of this extension) BUT watch it update live with the changes in this PR. 🎉

Here's the repro I was using in when running this extension in debug mode:

{
    {
      "// ! This guy will not update unless you have the code changes in this PR active
      "text": "// !", // 👈 change this to anything else and save and see if the above changes immediately or not
      "backgroundColor": "rgba(65, 166, 181, 0.8)",
      "border": "2px solid #41a6b5",
      "isWholeLine": true
    }
}

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.

1 participant