flycheck / flycheck-inline

Display Flycheck errors inline
GNU General Public License v3.0
137 stars 10 forks source link

Only clear overlays when point has left the error region #17

Closed loafofpiecrust closed 4 years ago

loafofpiecrust commented 4 years ago

Fixes #16 by adding the flycheck error as a property to each overlay and only clearing overlays whose error doesn't contain point. This results in, IMO, a much smoother experience with this mode. Hopefully there isn't a fundamental issue with my approach. I've only tested in emacs-lisp-mode and rustic-mode (with LSP). Works for sub-line and multi-line errors alike. Not sure if this should be a toggle or if others consider it a direct upgrade as I do.

Here's a short screencast of rust code in DOOM with a few errors that hopefully demonstrates the change for someone that's used this mode previously: flycheck-pr

fmdkdd commented 4 years ago

Hey, sorry for the delay. This is a very nice patch, and I think we can merge this.

I guess another fix would be on flycheck side directly to avoid triggering flycheck-display-error when point is already in the error. But your patch is great.

Did you have time to test drive it a bit?

loafofpiecrust commented 4 years ago

Thanks for the feedback. I've been using this branch for a few weeks and AFAICT it works great.

fmdkdd commented 4 years ago

Let's roll with it then. Thanks again for the patch!