Fix regression with term and evil-escape

Now `f` is correctly inserted in term buffers.
This commit is contained in:
syl20bnr 2015-01-20 12:06:52 -05:00
parent accf1e39af
commit fc2d093b47

View file

@ -5,7 +5,7 @@
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; Keywords: convenience editing evil
;; Created: 22 Oct 2014
;; Version: 2.03
;; Version: 2.04
;; Package-Requires: ((emacs "24") (evil "1.0.9"))
;; URL: https://github.com/syl20bnr/evil-escape
@ -152,9 +152,13 @@ with a key sequence."
(lookup-key evil-motion-state-map (evil-escape--first-key)))
;; evil states
;; insert state
(eval `(evil-escape-define-escape "insert-state" evil-insert-state-map evil-normal-state
:insert-func evil-escape--default-insert-func
:delete-func evil-escape--default-delete-func))
(let ((insert-func (lambda (key) (interactive)
(cond ((eq 'term-mode major-mode)
(call-interactively 'term-send-raw))
(t (evil-escape--default-insert-func key))))))
(eval `(evil-escape-define-escape "insert-state" evil-insert-state-map evil-normal-state
:insert-func ,insert-func
:delete-func evil-escape--default-delete-func)))
;; emacs state
(let ((exit-func (lambda () (interactive)
(cond ((string-match "magit" (symbol-name major-mode))
@ -244,6 +248,10 @@ with a key sequence."
"Send `q' key press event to exit from a buffer."
(setq unread-command-events (listify-key-sequence "q")))
(defun evil-escape--term-insert-func (key)
"Insert KEY in current term buffer."
(term-send-raw))
(defun evil-escape--execute-shadowed-func (func)
"Execute the passed FUNC if the context allows it."
(unless (or (null func)