Make interactive installation of python layer not fail

If a layer is interactively installed by visiting a file the progress
file is updated without being properly initialized before causing a
division by zero.

Now `spacemacs/update-progress-bar` will ignore the call if
`spacemacs-loading-dots-chunk-threshold` is <= 0.
This commit is contained in:
Maximilian Wolff 2020-02-25 22:14:01 +01:00
parent 6049d901f6
commit f44047ccdc
No known key found for this signature in database
GPG Key ID: 2DD07025BFDBD89A
1 changed files with 2 additions and 1 deletions

View File

@ -35,8 +35,9 @@
(defun spacemacs/update-progress-bar ()
"Update progress bar by incrementing its value by 1.
Display the progress bar by chunks of size `spacemacs--loading-dots-chunk-threshold'"
Display the progress bar by chunks of size `spacemacs-loading-dots-chunk-threshold'"
(when (and (not noninteractive)
(> spacemacs-loading-dots-chunk-threshold 0)
dotspacemacs-loading-progress-bar)
(setq spacemacs-loading-counter (1+ spacemacs-loading-counter))
(setq spacemacs-loading-value (1+ spacemacs-loading-value))