diff options
| author | Justin Burkett <justin@burkett.cc> | 2019-08-08 22:11:03 -0400 |
|---|---|---|
| committer | Eivind Fonn <evfonn@gmail.com> | 2019-11-05 10:20:42 +0100 |
| commit | aa3ea1dcfc54fe25581841a8685679d482e99b3f (patch) | |
| tree | 19c82fd33fa456b9b2b54d8487b337f204fe762d /evil-states.el | |
| parent | 45606ec27cbeb7d074ab92658b496950c40dc76b (diff) | |
Unwed evil-move-beyond-eol and evil-move-cursor-back
The docstring of evil-cursor-back only mentions that it applies to moving the
cursor back when exiting insert state, but in many cases it was tied to also
moving the cursor when reaching the end of the line. We have
evil-move-beyond-eol to control that behavior, and there doesn't seem to be a
good reason that the two must be tied together.
Fixes #1178
Diffstat (limited to 'evil-states.el')
| -rw-r--r-- | evil-states.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/evil-states.el b/evil-states.el index 8cb2c32..8ffc1d6 100644 --- a/evil-states.el +++ b/evil-states.el @@ -128,10 +128,10 @@ commands opening a new line." (evil-set-marker ?^ nil t) (unless (eq evil-want-fine-undo t) (evil-end-undo-step)) - (when evil-move-cursor-back - (when (or (evil-normal-state-p evil-next-state) - (evil-motion-state-p evil-next-state)) - (evil-move-cursor-back)))))) + (when (or (evil-normal-state-p evil-next-state) + (evil-motion-state-p evil-next-state)) + (evil-move-cursor-back + (and (eolp) (not evil-move-beyond-eol))))))) (defun evil-insert-repeat-hook () "Record insertion keys in `evil-insert-repeat-info'." @@ -856,8 +856,7 @@ CORNER defaults to `upper-left'." (remove-hook 'pre-command-hook #'evil-replace-pre-command t) (unless (eq evil-want-fine-undo t) (evil-end-undo-step)) - (when evil-move-cursor-back - (evil-move-cursor-back)))) + (evil-move-cursor-back))) (setq evil-replace-alist nil)) (defun evil-replace-pre-command () |
