From 6094bb05f3a78687529b55674dbdd697e51e1c25 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Thu, 14 Nov 2024 01:10:08 -0500 Subject: [PATCH] refactor: better error messages --- winum.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winum.el b/winum.el index 5ef6070..6088f4f 100644 --- a/winum.el +++ b/winum.el @@ -258,7 +258,9 @@ Needed to detect scope changes at runtime.") "Jump to window 0, or window 10 if 0 is not assigned. If prefix ARG is given, delete the window instead of selecting it." (interactive "P") - (let ((n (if (winum-get-window-by-index 0) 0 10))) + (let ((n (or (and (winum-get-window-by-index 0) 0) + (and (winum-get-window-by-index 10) 10) + (user-error "No window with index 0 or 10")))) (if arg (winum-delete-window-by-index n) (winum-select-window-by-index n))))