Alexander-Miller / treemacs

GNU General Public License v3.0
2.11k stars 155 forks source link

Magit Ediff opens two new windows and displays original window #1080

Open kjmph opened 10 months ago

kjmph commented 10 months ago

When treemacs is open, running (magit-ediff) results in showing two new windows, the original editing buffer, and treemacs' sidebar when treemacs was open. So, while I expect two windows showing diff-A on the left and diff-B on the right, instead I see treemacs | buffer | diff-A | diff-B displayed. (Note, I would accept treemacs | diff-A | diff-B as an arrangement.. I just don't want to see multiple copies as if it were a three way merge)

I was able to fix this locally via:

(defun ediff-styling ()
  (pcase (treemacs-current-visibility)
    ('visible (treemacs))))
(add-hook 'ediff-before-setup-hook 'ediff-styling)

I don't know if this helps anyone else. This can be reproduced via opening treemacs and running (magit-ediff) on a buffer with edits, and then showing unstaged changes.

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

Alexander-Miller commented 3 months ago

I cannot reproduce this on my end:

https://github.com/user-attachments/assets/da8aa4bf-0c78-459d-b6c2-ad5f65785d8b

My guess is that the exact behavior depends on your magit/ediff/general window settings - there is nothing special about treemacs in this regard, it's just a regular window and buffer as far as Emacs is concerned.

If you want to compare settings you can find my config here: https://github.com/Alexander-Miller/dotfiles/tree/master/.config/emacs/modules.

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).