Skip to content

Commit 8cbb0e4

Browse files
committed
Fixes #2021: Fix 'wrong-type-argument wholenump' in evil-line-move
When moving past the beginning of a buffer, evil-line-move can signal a wrong-type-argument wholenump error. This occurs when the visual column calculation results in a negative float for temporary-goal-column.
1 parent 729d9a5 commit 8cbb0e4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

evil-common.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,9 +1255,10 @@ Signal an error at buffer boundaries unless NOERROR is non-nil."
12551255
(condition-case err
12561256
(line-move count)
12571257
((beginning-of-buffer end-of-buffer)
1258-
(let ((col (or goal-column
1259-
(car-safe temporary-goal-column)
1260-
temporary-goal-column)))
1258+
(let* ((raw-col (or goal-column
1259+
(car-safe temporary-goal-column)
1260+
temporary-goal-column))
1261+
(col (if (numberp raw-col) (max 0 raw-col) 0)))
12611262
(line-move-finish col opoint (< count 0)))
12621263
(or noerror (/= (point) opoint) (signal (car err) (cdr err))))))))
12631264

0 commit comments

Comments
 (0)