-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
not always refreshing when commiting outside of emacs? #86
Comments
Would you tell me your Emacs version and OS ? I know focus hooks works on Linux however I don't know whether it works on other platforms(MacOSX, Windows etc). |
I have GNU Emacs 24.4.1, linux (fedora). I only use emacs in the GUI. As I On Mon, Apr 6, 2015 at 3:13 PM, Syohei YOSHIDA [email protected]
|
I've added this to my init function: (add-hook 'focus-in-hook (lambda () (message "hello"))) and hello is displayed on focus. So I think that's not the problem. |
Thanks for information. |
It's a simple of having a clean repo, modifying the file, comitting outside of emacs, and the status doesn't update in emacs. In fact I even tried to call manually git-gutter:update-all-windows (M-x git-gutter:update-all-windows ENTER) but also that did not help. The status in git-gutter remained obsolete. I tried to reproduce it with a sample project but this time it works. All I can say is that in some cases it doesn't... |
Maybe you can tell me what to try doing the next time I hit the issue so that I try to narrow the source of the problem? |
It's not with the repository, restarting emacs solves the problem. It's I'll probably add debug messages and look at them when i reproduce.. On 7 Apr 2015 16:53, "Syohei YOSHIDA" [email protected] wrote:
|
I just reproduced the issue just putting videos in case it helps somehow. As i said, manually calling the function to update the status does not help. Killing emacs and restarting it does help. I wonder if there's maybe a connection with the fact that I use emacs-client. Anyway, videos: PS: I'm not trying to reproduce the problem, just using git-gutter while working on other projects for now. If still no solution arise I'll guess I'll start looking at the git-gutter source but I didn't come around to doing that yet. |
it's possible that i have this problem only when using emacs-client. not sure yet, just a theory. |
Thanks for information. |
Same here. Reproducible almost on every commit. Running M-x git-gutter refreshes the buffer correctly. I am using linum-mode, actually linum-relative along with git-gutter-fringe. The update-interval seems to have no effect: (global-git-gutter-mode t) Please, if you need further information, just ask. |
just FYI I was using |
partial solution for current version of magit: |
Edited: Solution1: ;; Update all window when Emacs focus in.
;; This fixes git gutter cannot update the file status after committing outside of Emacs.
(add-hook 'focus-in-hook 'git-gutter:update-all-windows) Solution2: ;; Revert buffer without confirm when buffer focus in.
;; This fixes git gutter cannot update the file status after committing outside of Emacs.
(add-hook 'focus-in-hook 'revert-buffer-no-confirm)
(defun revert-buffer-no-confirm ()
"Revert buffer without confirmation."
(interactive) (revert-buffer t t)) Confirmed on MacOS 11.0 Beta (20A4300b) The correct status is showed after running |
I'm not using (yet?) magit for committing, but rather commiting in a terminal outside of emacs.
As a result, git-gutter still reflects the status of before the commit, does not pick up the change.
I have added this to my emacs config and was sure it would help, but it does not:
(require 'git-gutter)
(add-to-list 'git-gutter:update-hooks 'focus-in-hook)
Also when git-gutter is displaying obsolete information, running "git-gutter:update-all-windows" still does not get rid of the obsolete information.
I'm pretty sure I misconfigured something... I'm using spacemacs otherwise, and I put the focus-in-hook thing in the:
(defun dotspacemacs/config ()
"Configuration function.
This function is called at the very end of Spacemacs initialization after
layers configuration."
The text was updated successfully, but these errors were encountered: