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 clearing highlighted yank in editors within modal dialogs #871

Merged

Conversation

citizenmatt
Copy link
Member

@citizenmatt citizenmatt commented May 7, 2024

This PR fixes a modality issue with the timer to clear the highlighted yank extension's highlights. If the editor was hosted inside a modal dialog (e.g. Live Templates in Settings), or shown from a modal dialog (e.g. Resolve Conflicts dialog), then the timer callback would wait for the modal dialog to close before clearing the highlights. This fixes VIM-2236.

These changes also fix some other minor issues with the highlighted yank extension:

  • A memory leak caused by registering a disposable against a project service to clean up highlights for every single yank.
  • Config variables such as g:highlightedyank_highlight_duration can be a number as well as a string, matching the original Vim plugin.
  • Highlights are cleared when IdeaVim is disabled
  • Removed unnecessary Java version of the test. It's not language specific

Also fixes a memory leak registering a disposable for each yank, allows config variables to be numbers rather than strings and removes highlights when IdeaVim is disabled

Fixes VIM-2236
@citizenmatt citizenmatt force-pushed the bugfix/highlighted-yank-fixes branch from 356a9ff to f6acbfa Compare May 8, 2024 09:32
@AlexPl292
Copy link
Member

Looks good to me, thank you for the update!

@AlexPl292 AlexPl292 merged commit f382544 into JetBrains:master May 24, 2024
4 checks passed
@citizenmatt citizenmatt deleted the bugfix/highlighted-yank-fixes branch May 28, 2024 13:30
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