Skip to content

Commit

Permalink
Add support for read-only buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Sep 22, 2015
1 parent c23a84d commit 9f7ed13
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions evil-escape.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 9f7ed13

Please sign in to comment.