Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using right margin for display doesn't work with more than 1 window in terminal #61

Closed
jbmorgado opened this issue Jan 11, 2016 · 5 comments

Comments

@jbmorgado
Copy link

When using the right side margin for diff symbol display with a vertical split window setup in the terminal, diff-hl only works for the file being displayed in the rightmost window.

The bug only appears in terminal mode, it works as expected in graphical Emacs.

(use-package diff-hl
  :ensure t
  :defer t
  :init
  (progn
    (setq diff-hl-side 'right)
    (global-diff-hl-mode)
    (diff-hl-margin-mode)
    (diff-hl-flydiff-mode)))
@dgutov
Copy link
Owner

dgutov commented Jan 11, 2016

Try putting this into your init file:

(setq-default right-margin-width 2)

@jbmorgado
Copy link
Author

Hi, that doesn't work, but from your help, I did:

(add-hook 'window-configuration-change-hook
          (lambda ()
            (set-window-margins (car (get-buffer-window-list (current-buffer) nil t)) nil 2)))

And this works.
Don't know anything about elisp so I don't know why that works, but it's fine for me.

@dgutov
Copy link
Owner

dgutov commented Jan 11, 2016

Hi, that doesn't work

Did you try restarting Emacs?

@jbmorgado
Copy link
Author

Yes I did. But like I told you, the other option works fine, so I'll stick to that as a workaround. Thank you.

@dgutov
Copy link
Owner

dgutov commented Jan 11, 2016

Too bad, it works for me.

I'm happy you've found a workaround, of course. By the way, you can use get-buffer-window instead of (car (get-buffer-window-list ...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants