refactor: better error messages

This commit is contained in:
Kiana Sheibani 2024-11-14 01:10:08 -05:00
parent efa0aedb7c
commit 6094bb05f3
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -258,7 +258,9 @@ Needed to detect scope changes at runtime.")
"Jump to window 0, or window 10 if 0 is not assigned. "Jump to window 0, or window 10 if 0 is not assigned.
If prefix ARG is given, delete the window instead of selecting it." If prefix ARG is given, delete the window instead of selecting it."
(interactive "P") (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 (if arg
(winum-delete-window-by-index n) (winum-delete-window-by-index n)
(winum-select-window-by-index n)))) (winum-select-window-by-index n))))