Fix highlighting after reselection of same word
Fixes #1483
- Ensure selection is updated in plugin when selection changes by clicking elsewhere
- Simplify and DRY some code
Throttling the update-spaces function was tried but the resulting lag was found to be distracting so now they are updated straight-away as before. This is inefficient but any improvement can be left for another PR.
@zeebok You may like to take a look at this and let me know if by any chance it also fixes the crashing problem we discussed.
@zeebok I see what you mean. I have now separated the throttle for the selection change signal so that can be faster. Could you reproduce the crash on BackSpace issue with this PR?
@jeremypw I will try to take a look at this review again this week!
Converting to draft as there seems to be some code from the dogfood fork accidentally merged here!