branch: elpa/evil-escape commit 9f7ed13160b17139512e4baa9201006c1569cf3e Author: syl20bnr <sylvain.ben...@gmail.com> Commit: syl20bnr <sylvain.ben...@gmail.com>
Add support for read-only buffers --- evil-escape.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/evil-escape.el b/evil-escape.el index ecaa4991c1..260fcfce9a 100644 --- a/evil-escape.el +++ b/evil-escape.el @@ -244,13 +244,15 @@ with a key sequence." (defun evil-escape--insert () "Insert the first key of the sequence." - (pcase evil-state - (`insert (evil-escape--insert-2) t) - (`emacs (evil-escape--insert-2) t) - (`hybrid (evil-escape--insert-2) t) - (`normal - (when (window-minibuffer-p) (evil-escape--insert-func) t)) - (`iedit-insert (evil-escape--insert-func) t))) + (condition-case err + (pcase evil-state + (`insert (evil-escape--insert-2) t) + (`emacs (evil-escape--insert-2) t) + (`hybrid (evil-escape--insert-2) t) + (`normal + (when (window-minibuffer-p) (evil-escape--insert-func) t)) + (`iedit-insert (evil-escape--insert-func) t)) + ('error nil))) (defun evil-escape--insert-2 () "Insert character while taking into account mode specificites."