From 16da9ee1d6be3cc275a5e339f317bc2283f35016 Mon Sep 17 00:00:00 2001 From: Jason Zhen <15258281+JasZhe@users.noreply.github.com> Date: Tue, 4 Nov 2025 19:52:57 -0500 Subject: [PATCH] fix: off by one when switching workspaces --- modules/ui/workspaces/autoload/evil.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ui/workspaces/autoload/evil.el b/modules/ui/workspaces/autoload/evil.el index bb904e540..2e79a41af 100644 --- a/modules/ui/workspaces/autoload/evil.el +++ b/modules/ui/workspaces/autoload/evil.el @@ -30,10 +30,10 @@ (evil-define-command +workspace:switch-next (&optional count) "Switch to next workspace. If COUNT, switch to COUNT-th workspace." (interactive "") - (if count (+workspace/switch-to count) (+workspace/cycle +1))) + (if count (+workspace/switch-to (max (1- count) 0)) (+workspace/cycle +1))) ;;;###autoload (autoload '+workspace:switch-previous "ui/workspaces/autoload/evil" nil t) (evil-define-command +workspace:switch-previous (&optional count) "Switch to previous workspace. If COUNT, switch to COUNT-th workspace." (interactive "") - (if count (+workspace/switch-to count) (+workspace/cycle -1))) + (if count (+workspace/switch-to (max (1- count) 0)) (+workspace/cycle -1)))