aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--evil-commands.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/evil-commands.el b/evil-commands.el
index c3e42d6..ffd5955 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -2811,9 +2811,10 @@ The insertion will be repeated COUNT times."
(setq evil-insert-count count
evil-insert-lines t
evil-insert-vcount nil)
- (when evil-auto-indent
- (indent-according-to-mode))
- (evil-insert-state 1))
+ (unwind-protect
+ (when evil-auto-indent
+ (indent-according-to-mode))
+ (evil-insert-state 1)))
(evil-define-command evil-open-below (count)
"Insert a new line below point and switch to Insert state.
@@ -2827,9 +2828,10 @@ The insertion will be repeated COUNT times."
(setq evil-insert-count count
evil-insert-lines t
evil-insert-vcount nil)
- (when evil-auto-indent
- (indent-according-to-mode))
- (evil-insert-state 1))
+ (unwind-protect
+ (when evil-auto-indent
+ (indent-according-to-mode))
+ (evil-insert-state 1)))
(defun evil--insert-line (count vcount non-blank-p)
"Switch to insert state at the beginning of the current line.