branch: externals/indent-bars
commit 0c17a218eefa3f418c5e4c5fb5ff6cba68c03553
Author: JD Smith <93749+jdtsm...@users.noreply.github.com>
Commit: JD Smith <93749+jdtsm...@users.noreply.github.com>

    Fix variable-pitch-mode detection
---
 indent-bars.el | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/indent-bars.el b/indent-bars.el
index 7c64195a8e..99e096c079 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -930,17 +930,19 @@ Useful for calling after theme changes."
        (ibs/no-stipple-chars style) (indent-bars--create-no-stipple-chars 
style 7))
 
   ;; Base stipple face
-  (let ((width (or (and (bound-and-true-p variable-pitch-mode)
-                       (with-silent-modifications
-                         (let ((inhibit-read-only t))
-                           (unwind-protect
-                               (save-excursion
-                                 (insert-before-markers ?\s)
-                                 (when-let ((wh (posn-object-width-height 
(posn-at-point (1- (point))))))
-                                   (message "indent-bars: using variable pitch 
width = %d" (car wh))
-                                   (car wh)))
-                             (delete-char -1)))))
-                  (frame-char-width))))
+  (let ((width
+        (or (when-let* ((remap (alist-get 'default face-remapping-alist))
+                        ( (memq 'variable-pitch remap))) ; variable-pitch-mode
+              (with-silent-modifications
+                (let ((inhibit-read-only t))
+                  (unwind-protect
+                      (save-excursion
+                        (insert-before-markers ?\s)
+                        (when-let ((wh (posn-object-width-height 
(posn-at-point (1- (point))))))
+                          (message "indent-bars: using variable pitch width = 
%d" (car wh))
+                          (car wh)))
+                    (delete-char -1)))))
+            (frame-char-width))))
     (face-spec-set
      (ibs/stipple-face style)
      (indent-bars--stipple-face-spec width (frame-char-height)

Reply via email to