emacsorphanage / git-gutter-fringe

Fringe version of git-gutter.el
162 stars 17 forks source link

Unclearable overlays #23

Closed ryanartecona closed 2 years ago

ryanartecona commented 9 years ago

version: GNU Emacs 24.4.1 (x86_64-apple-darwin14.1.0, Carbon Version 157 AppKit 1344.72)

Occasionally I will get git-gutter-fringe overlays stuck in my fringe which I can't clear by toggling the fringe, toggling linum, or even calling git-gutter:clear or git-gutter-fr:clear.

I don't know exactly what triggers this. I think it may only happen when there's only 1 hunk left to show in the gutter (e.g. after making a few edits to a file, and then undoing them one by one), but then again that may be only because I only notice after undoing all my temporary edits to a file.

I did some poking, and it looks like the 'git-gutter property on the overlays gets removed without the overlays themselves getting removed. That is, (overlay-get ov 'git-gutter) returns nil on an overlay that I can clearly see is still showing a git-gutter-fringe overlay in it.

This could be a git-gutter problem instead of something specific to git-gutter-fringe, but I only use git-gutter-fringe so I couldn't tell.

ereslibre commented 9 years ago

This is probably related to https://github.com/syohex/emacs-git-gutter/issues/86

stakemori commented 8 years ago

The return values of fringe-helper-insert-region have properties insert-in-front-hooks and modification-hooks. See https://github.com/nschum/fringe-helper.el/blob/master/fringe-helper.el#L175.

And the function fringe-helper-modification-func is added to those hooks. It creates new overlays which do not have the git-gutter property when text is modified or inserted.

So I guess setting insert-in-front-hooks and modification-hooks to nil for the return values of fringe-helper-insert-region fixes this issue. But I do not quite understand why just calling fringe-helper-remove does not work (I read the comment).

syohex commented 8 years ago

28 was merged. Please check latest version.

gonewest818 commented 2 years ago

I'm closing this issue since it's been over 5 years since #28 was merged. Please reopen if there is still an issue here. Thanks!