Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #502, fixes #1835. Refreshing the cursor when changing the evil state is only needed (or almost only, see below) when the current buffer is displayed in the selected window. If this is not the case, and the buffer is only displayed or its window selected at some later point in time, then `evil-refresh-cursor` will be called as part of the `window-configuration-change-hook` or as advice to `select-window`. However, this introduces the following tiny (and maybe acceptable?) regression: When doing something like ```elisp (with-current-buffer (some-buffer-displayed-in-another-window) (some-evil-state-with-a-different-cursor-type)) ``` the cursor will not be refreshed in the other window before selecting it. The cursor colour should indeed not be refreshed, because it is defined for the whole frame; however, the cursor type should in principle be changed, as it is defined per buffer and also defines the shape of the cursor in non-selected windows. There exist different ways to also handle this case, but they mostly seem ugly or needlessly complicated to me. I think the most elegant way to fix this would involve implementing per-buffer cursor colors in Emacs (as suggested in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24153d). What do you think?
- Loading branch information