From 2c24674da900d0d9ab463c8d22646437399fcdf8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 2 May 2020 12:22:18 -0400 Subject: [PATCH] Merge syl20bnr/evil-escape#91 Fixes syl20bnr/evil-escape#84 Co-authored-by: kiennq --- evil-escape.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/evil-escape.el b/evil-escape.el index 587f310..6dc9a69 100644 --- a/evil-escape.el +++ b/evil-escape.el @@ -180,13 +180,21 @@ with a key sequence." "evil-escape pre-command hook." (with-demoted-errors "evil-escape: Error %S" (when (evil-escape-p) - (let* ((modified (buffer-modified-p)) + (let* (;; NOTE Add syl20bnr/evil-escape#91: inhibit redisplay and + ;; refontification after a `read-event'. + (inhibit-redisplay nil) + (fontification-functions nil) + + (modified (buffer-modified-p)) (inserted (evil-escape--insert)) (fkey (elt evil-escape-key-sequence 0)) (skey (elt evil-escape-key-sequence 1)) (evt (read-event nil nil evil-escape-delay))) (when inserted (evil-escape--delete)) - (set-buffer-modified-p modified) + ;; NOTE Add syl20bnr/evil-escape#91: replace `set-buffer-modified-p' + ;; with `restore-buffer-modified-p', which doesn't redisplay the + ;; modeline after changing the buffer's modified state. + (restore-buffer-modified-p modified) (cond ((and (characterp evt) (or (and (equal (this-command-keys) (evil-escape--first-key))