branch: externals/window-commander commit 5446df0f3ee4ab08bc3743a1c21d5476f86f8864 Author: Daniel Semyonov <cm...@dsemy.com> Commit: Daniel Semyonov <cm...@dsemy.com>
* swsw.el (swsw--get-id-length): Fix the calculation of the ID length --- swsw.el | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/swsw.el b/swsw.el index e9c836fc74..597f53ab28 100644 --- a/swsw.el +++ b/swsw.el @@ -141,13 +141,9 @@ If set to ‘lighter’, use the mode line lighter of ‘swsw-mode’." (defun swsw--get-id-length () "Return the current length of a window ID." - (let* ((windows (length (window-list-1 nil nil (swsw--get-scope)))) - (chars (length swsw-id-chars)) - (div (/ windows chars))) - ;; Check the remainder to avoid returning a longer length than necessary. - (if (= 0 (mod windows chars)) - div - (1+ div)))) + (ceiling (log + (length (window-list-1 nil nil (swsw--get-scope))) + (length swsw-id-chars)))) (defun swsw-update-window (window) "Update information for WINDOW."