From 92102f3b30d03d1d87b34ae2c01e4bc2013d5129 Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Sun, 11 Aug 2019 21:37:30 -0400 Subject: Remove force argument from evil-adjust-cursor The conditions checked in the body of the function are sufficient to guarantee that the cursor should move back so there is no need to check the variable evil-move-cursor-back, which is what the force argument allows for. --- evil-common.el | 7 +++---- evil-macros.el | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/evil-common.el b/evil-common.el index 26b6b39..263de7e 100644 --- a/evil-common.el +++ b/evil-common.el @@ -973,10 +973,9 @@ Like `move-end-of-line', but retains the goal column." (move-end-of-line arg) (end-of-line))) -(defun evil-adjust-cursor (&optional force) +(defun evil-adjust-cursor (&optional _) "Move point one character back if at the end of a non-empty line. -This behavior is contingent on the variable `evil-move-cursor-back'; -use the FORCE parameter to override it." +This behavior is controled by `evil-move-beyond-eol'." (when (and (eolp) (not evil-move-beyond-eol) (not (bolp)) @@ -984,7 +983,7 @@ use the FORCE parameter to override it." (save-excursion (evil-move-end-of-line) (point)))) - (evil-move-cursor-back force))) + (evil-move-cursor-back t))) (defun evil-move-cursor-back (&optional force) "Move point one character back within the current line. diff --git a/evil-macros.el b/evil-macros.el index 66d550d..b820545 100644 --- a/evil-macros.el +++ b/evil-macros.el @@ -295,7 +295,7 @@ of the object; otherwise it is placed at the end of the object." (unless (bobp) (backward-char))) (when (or (evil-normal-state-p) (evil-motion-state-p)) - (evil-adjust-cursor t))))) + (evil-adjust-cursor))))) ((> count 0) (when (evil-eobp) (signal 'end-of-buffer nil)) @@ -310,7 +310,7 @@ of the object; otherwise it is placed at the end of the object." (unless (bobp) (backward-char))) (when (or (evil-normal-state-p) (evil-motion-state-p)) - (evil-adjust-cursor t))))) + (evil-adjust-cursor))))) (t count)))) -- cgit v1.0