emacsorphanage / git-gutter

Emacs port of GitGutter which is Sublime Text Plugin
835 stars 70 forks source link

Magit Ediff integration problems #168

Open kjmph opened 4 years ago

kjmph commented 4 years ago

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!

gonewest818 commented 4 years ago

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

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

kjmph commented 3 years ago

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?

gonewest818 commented 3 years ago

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?

gonewest818 commented 3 years ago

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.

gonewest818 commented 3 years ago

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.

kjmph commented 3 years ago

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.