branch: elpa/evil commit 5a9cfbc443219c4063b17853b7828ec0a00d2736 Author: Sean Smith <scsmi...@gmail.com> Commit: Tom Dalziel <33435574+tomd...@users.noreply.github.com>
Prevent setting a negative value for `temporary-goal-column` --- evil-common.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/evil-common.el b/evil-common.el index 672e34381c..6b9f6944dc 100644 --- a/evil-common.el +++ b/evil-common.el @@ -993,8 +993,12 @@ so it is more compatible with evil's notions of eol & tracking." (debug t)) (let ((normalize-temporary-goal-column `(if (consp temporary-goal-column) - (setq temporary-goal-column (+ (car temporary-goal-column) - (cdr temporary-goal-column)))))) + ;; Ensure a negative value is never set for `temporary-goal-column' + ;; as it may have a negative component when both `whitespace-mode' + ;; and `display-line-numbers-mode' are enabled. + ;; See #1297 + (setq temporary-goal-column (max 0 (+ (car temporary-goal-column) + (cdr temporary-goal-column))))))) `(progn (unless evil-start-of-line (setq this-command 'next-line)) ,normalize-temporary-goal-column