fetch a window even if its index is larger than window-count
The index of a window in window-vector can be greater than the number of live windows if its number was assigned by winum-assign-func. also partly fixes #4
This commit is contained in:
parent
4bee4987bc
commit
66c598a4e6
5
winum.el
5
winum.el
|
@ -314,8 +314,9 @@ PREFIX must be a key sequence, like the ones returned by `kbd'."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun winum-get-window-by-number (n)
|
(defun winum-get-window-by-number (n)
|
||||||
"Return window numbered N if exists, nil otherwise."
|
"Return window numbered N if exists, nil otherwise."
|
||||||
(when (and (>= n 0) (< n (1+ winum--window-count)))
|
(let ((window-vector (winum--get-window-vector)))
|
||||||
(aref (winum--get-window-vector) n)))
|
(when (and (>= n 0) (< n (length window-vector)))
|
||||||
|
(aref window-vector n))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun winum-get-number-string (&optional window)
|
(defun winum-get-number-string (&optional window)
|
||||||
|
|
Loading…
Reference in a new issue