git-gutter icon indicating copy to clipboard operation
git-gutter copied to clipboard

visual-fill-column-mode prevents gutter to show up

Open farynaio opened this issue 4 years ago • 1 comments

I found git-gutter don't work with visual-fill-column-mode.

Is there any way to work around this?

farynaio avatar Mar 16 '21 14:03 farynaio

I have a work-around, but what it does is disable 'visual-line-mode' while 'git-gutter-mode' is active, so it isn't a perfect solution. If @farynaio and @purcell approve, I'll prepare it as a PR, but the code looks like this:

(make-variable-buffer-local 'git-gutter:visual-line)
(defun git-gutter-visual-line ()
  "Hook function for interoperability.
Package 'git-gutter' doesn't play with 'visual-line-mode', so we
disable that mode while 'git-gutter' is active."
  (cond
   (git-gutter-mode
     (setq git-gutter:visual-line visual-line-mode)
     (visual-line-mode -1))
   (t
     (visual-line-mode git-gutter:visual-line))))

(add-to-list 'git-gutter-mode-on-hook 'git-gutter-visual-line)
(add-to-list 'git-gutter-mode-off-hook 'git-gutter-visual-line)

My opinion is that this bug is pretty important because my first attempts to use this package were in org-mode with visual-line-mode enabled and if it weren't a slow off-day, I wouldn't have bothered with the frustration , and would have just rejected the package.

Boruch-Baum avatar Dec 31 '23 18:12 Boruch-Baum