mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-27 13:07:59 +01:00
Fix a workspace switch issue
* exwm-workspace.el (exwm-workspace--switch-map-nth-prefix): Add more checking conditions.
This commit is contained in:
parent
b409d873b6
commit
37e51e65ad
1 changed files with 10 additions and 4 deletions
|
@ -337,11 +337,17 @@ PREFIX-DIGITS is a list of the digits introduced so far."
|
||||||
(* o x))
|
(* o x))
|
||||||
prefix-digits)))
|
prefix-digits)))
|
||||||
(n (+ pn d))
|
(n (+ pn d))
|
||||||
(num-workspaces (exwm-workspace--count)))
|
prefix-length index-max index-length)
|
||||||
(if (= (length prefix-digits)
|
(if (or (= n 0)
|
||||||
(floor (log (1- num-workspaces) 10)))
|
(> n
|
||||||
|
(setq index-max (1- (exwm-workspace--count))))
|
||||||
|
(>= (setq prefix-length (length prefix-digits))
|
||||||
|
(setq index-length (floor (log index-max 10))))
|
||||||
|
;; Check if it's still possible to do a match.
|
||||||
|
(> (* n (expt 10 (- index-length prefix-length)))
|
||||||
|
index-max))
|
||||||
(exwm-workspace--switch-map-select-nth n)
|
(exwm-workspace--switch-map-select-nth n)
|
||||||
;; go ahead if there are enough digits to select any workspace.
|
;; Go ahead if there are enough digits to select any workspace.
|
||||||
(set-transient-map
|
(set-transient-map
|
||||||
(let ((map (make-sparse-keymap))
|
(let ((map (make-sparse-keymap))
|
||||||
(cmd `(lambda ()
|
(cmd `(lambda ()
|
||||||
|
|
Loading…
Reference in a new issue