return empty string instead of nil when window does not exist

protects against potential errors being thrown and probably fixes #3 (although
understanding the root cause is still necessary).
This commit is contained in:
deb0ch 2017-02-17 10:10:00 +01:00
parent 8e26306916
commit 3c28c0dd68

View file

@ -324,7 +324,9 @@ WINDOW: if specified, the window of which we want to know the number.
If not specified, the number of the currently selected window is
returned."
(let* ((n (winum-get-number window))
(s (when (numberp n) (int-to-string n))))
(s (if (numberp n)
(int-to-string n)
"")))
(propertize s 'face 'winum-face)))
;;;###autoload