Skip to content

Commit

Permalink
Set a fallback value for the right-divider-width in one place it was …
Browse files Browse the repository at this point in the history
…missing

We already do this in most places, but this one was not covered.
Thanks to Stefano Rodighiero for bringing this matter to my attention
in issue 11: <#11>.
  • Loading branch information
protesilaos committed Apr 29, 2024
1 parent 867a851 commit d9b2aad
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions spacious-padding.el
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,15 @@ Examples of valid configurations:
'(tab-line tab-line-tab tab-line-tab-inactive)
"Tab faces relevant to `spacious-padding-mode'.")

(defun spacious-padding--get-right-divider-width (&optional no-fallback)
"Get the width of window divider.
With optional NO-FALLBACK return nil if there is no value. Else return
a reasonable fallback value."
(cond
((plist-get spacious-padding-widths :right-divider-width))
(no-fallback nil)
(t 30)))

(defun spacious-padding--get-box-width (key &optional no-fallback)
"Get width for :box of face represented by KEY in `spacious-padding-widths'.
Return 4 if KEY does not have a value. If optional NO-FALLBACK
Expand Down Expand Up @@ -258,8 +267,9 @@ overline."
"Set window divider FACE to COLOR its width is greater than 1."
(list
face
`((t ,(when (> (plist-get spacious-padding-widths :right-divider-width) 1)
(list :background color :foreground color))))))
`((t
,(when (> (spacious-padding--get-right-divider-width) 1)
(list :background color :foreground color))))))

(defun spacious-padding-set-invisible-dividers (&rest _)
"Make window dividers invisible and add padding.
Expand Down

0 comments on commit d9b2aad

Please sign in to comment.