emacs-evil / evil-collection

A set of keybindings for evil-mode
GNU General Public License v3.0
1.21k stars 275 forks source link

Make magit-toggle-text-mode work in git-rebase-mode buffers #823

Closed emlun closed 2 months ago

emlun commented 2 months ago

evil-collection-magit-toggle-text-mode currently doesn't work in git-rebase-mode buffers, as the cond checks only for 'magit-mode. Thus the function just shows the error "evil-collection-magit-toggle-text-mode unexpected state" if invoked in a git-rebase-mode buffer. The C-t and \ bindings are also not set while in this mode.

These changes make evil-collection-magit-toggle-text-mode also work in git-rebase-mode, and set up the same key bindings in this mode. Because git-rebase-mode also enables read-only-mode in the buffer, we need to disable that too when switching to text-mode.