magit / magit

It's Magit! A Git Porcelain inside Emacs.
https://magit.vc
GNU General Public License v3.0
6.61k stars 819 forks source link

Bug: turn off magit-blame-mode and can not restore origin left-margin-width #5236

Closed liuyinz closed 1 month ago

liuyinz commented 1 month ago

How to reproduce:

  1. choose margin style as primary style in magit-blame-styles
  2. turn on magit-blame-mode
  3. turn off magit-blame-mode, and left-margin-width change to 0. due to function below
    (defun magit-blame--update-margin ()
    (setq left-margin-width (or (magit-blame--style-get 'margin-width) 0))
    (set-window-buffer (selected-window) (current-buffer)))

    would it be better to restore to origin margin-width instead of 0 when turn off magit-blame-mode or cycle-style ? I use diff-hl-marginmode with left-margin-width set to 1, and after turning off magit-blame-mode, width set to 0 amd diff-hl-margin-mode failed to show.

tarsius commented 1 month ago

Thanks for the report!