From 2978acd30ca425fcc004bff013b3405865ab8bfb Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Thu, 14 Nov 2024 00:54:29 -0500 Subject: [PATCH] refactor: use convenience macro in `winum` config --- config.org | 19 +++++++------------ pkgs/winum | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/config.org b/config.org index 235c52c..9e64f63 100644 --- a/config.org +++ b/config.org @@ -2421,19 +2421,13 @@ With the basic config out of the way, we can implement popup-aware numbering by (after! winum (defun ~/winum-auto-assign (windows) "Assign indices to windows, handling popup windows separately." - (let ((index 1) (popup-index 1)) + (let ((index 1) (popup-index '(popup . 1))) (dolist (w windows) (if (+popup-window-p w) - (progn - (while (member (cons 'popup popup-index) - winum--assigned-indices) - (setq popup-index (1+ popup-index))) - (winum--assign w (cons 'popup popup-index)) - (setq popup-index (1+ popup-index))) - (while (member index winum--assigned-indices) - (setq index (1+ index))) - (winum--assign w index) - (setq index (1+ index)))))) + (winum--assign-unique + w popup-index t + (cons 'popup-index (1+ (cdr popup-index)))) + (winum--assign-unique w index t))))) (setq winum-auto-assign-function #'~/winum-auto-assign)) #+end_src @@ -2467,7 +2461,8 @@ If prefix ARG is given, delete the window instead of selecting it." n) "Jump to popup window 0, or popup 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 '(popup . 0)) '(popup . 0) '(popup . 10)))) + (let ((n (if (winum-get-window-by-index '(popup . 0)) + '(popup . 0) '(popup . 10)))) (if arg (winum-delete-window-by-index n) (winum-select-window-by-index n)))) diff --git a/pkgs/winum b/pkgs/winum index aca0f74..efa0aed 160000 --- a/pkgs/winum +++ b/pkgs/winum @@ -1 +1 @@ -Subproject commit aca0f74f3a442b1b1a6f4315303c340f7c1005b8 +Subproject commit efa0aedb7c4c03fb287210cd248f5fad8d4442c9