emacsorphanage / git-gutter

Emacs port of GitGutter which is Sublime Text Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Magit Ediff integration problems

kjmph opened this issue · comments

Hello, thanks for the great project! However, there seems to be a bug when interacting with Magit and Ediff. If directly calling magit-ediff-show-working-tree, then git-gutter shows the gutter in ediff-window-A. Like so:

Screen Shot 2020-01-30 at 11 54 22 AM

I worked around this by binding a key to this function:

(defun magit-ediff-git-gutter-fix ()
  (interactive)
  (global-git-gutter-mode 0)
  (magit-ediff-show-working-tree (buffer-file-name))
  (global-git-gutter-mode 1))

This works for me, since 90% of my use cases are looking at the current buffer. This results in this output in my example:

Screen Shot 2020-01-30 at 11 54 38 AM

I don't have any pointers on why this is so. Is there anything else I can provide?

Thanks again!

I'm not seeing the same behavior as you are:

  • in Emacs 25.3, the "B" buffer is annotated with git-gutter signs.
  • in Emacs 26.3 and 27.0.90, neither buffer gets git-gutter signs.

Can you confirm which version of Emacs you're using and if this is still an issue?

Hello, sorry for my delay this summer. I'm using GNU Emacs 27.1. I checked, and this still happens. I'm happy to help you reproduce this, what could I provide for you?

Huh, well perhaps it's due to some other difference in the packages you and I are using (besides this one). It can be frustrating and a bit of a grind narrowing that down. But first let me try reproducing again with 27.1 and then see what we learn?

Ok, well the good news is I can now reproduce this (in 27.1) so I don't think I need more from you at this point... I just need time to dig into the reasons why.

Playing around a little more, I find I can get the gutter on the "B" side of the ediff by hitting a hotkey that causes the layout to rearrange ("?" for help, "|" to toggle vertical or horizontal layout of the two views). Or if you "~" to swap the contents of the views that also works, the gutter draws on the correct side and keeps drawing on the correct side even if you swap the views some more. This isn't a fix, but it's a place for me to look.

Thanks! I can confirm that also fixes the views by changing the layout. I'm glad you are on the case. Let me know if I can help at all.