aboutsummaryrefslogtreecommitdiff
path: root/evil-states.el
diff options
context:
space:
mode:
authorFrank Fischer <frank-fischer@shadow-soft.de>2014-11-13 05:32:48 +0100
committerFrank Fischer <frank-fischer@shadow-soft.de>2014-11-13 05:32:48 +0100
commit92a1737f75ae0b3626e9007b30df94acd7b25da8 (patch)
treeed2776c8b534afdbdbe26b27a79b4a15428e14e1 /evil-states.el
parent77920d30a9659dd70690ff061aa4bd4eb8fdb6d3 (diff)
add new possible value `fine` to `evil-want-fine-undo` (fix #444)
This value causes Evil to behave as if `evil-want-fine-undo` is t but merges the deletion of a change operator with the first subsequent insertion. This is implemented by removing only the first undo boundary in `evil-refresh-undo-step`.
Diffstat (limited to 'evil-states.el')
-rw-r--r--evil-states.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/evil-states.el b/evil-states.el
index 529632b..835ae09 100644
--- a/evil-states.el
+++ b/evil-states.el
@@ -81,14 +81,14 @@ If the region is activated, enter Visual state."
(cond
((evil-insert-state-p)
(add-hook 'pre-command-hook #'evil-insert-repeat-hook)
- (unless evil-want-fine-undo
+ (unless (eq evil-want-fine-undo t)
(evil-start-undo-step t)))
(t
(remove-hook 'pre-command-hook #'evil-insert-repeat-hook)
(setq evil-insert-repeat-info evil-repeat-info)
(evil-set-marker ?^ nil t)
- (unless evil-want-fine-undo
- (evil-end-undo-step t))
+ (unless (eq evil-want-fine-undo t)
+ (evil-end-undo-step t (eq evil-want-fine-undo 'fine)))
(when evil-move-cursor-back
(when (or (evil-normal-state-p evil-next-state)
(evil-motion-state-p evil-next-state))
@@ -819,12 +819,12 @@ CORNER defaults to `upper-left'."
((evil-replace-state-p)
(overwrite-mode 1)
(add-hook 'pre-command-hook #'evil-replace-pre-command nil t)
- (unless evil-want-fine-undo
+ (unless (eq evil-want-fine-undo t)
(evil-start-undo-step t)))
(t
(overwrite-mode -1)
(remove-hook 'pre-command-hook #'evil-replace-pre-command t)
- (unless evil-want-fine-undo
+ (unless (eq evil-want-fine-undo t)
(evil-end-undo-step t))
(when evil-move-cursor-back
(evil-move-cursor-back))))