Skip to content

Commit a58e44f

Browse files
committed
Goto last window when C-w w arg is > number of windows
1 parent 9c6b5f1 commit a58e44f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

evil-commands.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4411,7 +4411,7 @@ top-left."
44114411
(if (not count)
44124412
(select-window (next-window))
44134413
(evil-window-top-left)
4414-
(other-window (1- count))))
4414+
(other-window (1- (min count (length (window-list)))))))
44154415

44164416
(evil-define-command evil-window-prev (count)
44174417
"Move the cursor to the previous window in the cyclic order.
@@ -4422,7 +4422,7 @@ top-left."
44224422
(if (not count)
44234423
(select-window (previous-window))
44244424
(evil-window-top-left)
4425-
(other-window (1- count))))
4425+
(other-window (1- (min count (length (window-list)))))))
44264426

44274427
(evil-define-command evil-window-new (count file)
44284428
"Splits the current window horizontally

0 commit comments

Comments
 (0)