branch: externals/indent-bars
commit fffa4fe52d70bb291720f5ac07774686a882f32e
Author: JD Smith <[email protected]>
Commit: JD Smith <[email protected]>
Tweak remap removal.
There is still a bug in which remaps do not get correctly removed,
perhaps associated with reset.
---
indent-bars.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index a2cfc0b4e8..63705ae5d4 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -1173,13 +1173,13 @@ Works by remapping the appropriate
indent-bars[-style]-N face for
all styles in the `indent-bars--styles' list. DEPTH should be
greater than zero."
(dolist (s indent-bars--styles)
- (if (ibs/remap s) ; out with the old
- (face-remap-remove-relative (ibs/remap s)))
(let* ((face (indent-bars--face s depth))
(hl-col (and (ibs/current-depth-palette s)
(indent-bars--get-color s depth 'highlight)))
(hl-bg (ibs/current-bg-color s)))
(when (or hl-col hl-bg (ibs/current-depth-stipple s))
+ (when (ibs/remap s) ; out with the old
+ (face-remap-remove-relative (ibs/remap s)))
(setf (ibs/remap s)
(apply #'face-remap-add-relative face
`(,@(when hl-col `(:foreground ,hl-col))
@@ -1225,8 +1225,8 @@ W is the optional `window-font-width' and ROT is the
number of
bits to rotate the pattern. If W and ROT are not passed they
will be calculated."
(dolist (s indent-bars--styles)
- (if (ibs/remap-stipple s)
- (face-remap-remove-relative (ibs/remap-stipple s)))
+ (when (ibs/remap-stipple s)
+ (face-remap-remove-relative (ibs/remap-stipple s)))
(let* ((w (or w (window-font-width)))
(rot (or rot (indent-bars--stipple-rot w)))
(h (window-font-height)))