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

    Enable font-lock and ensure it initializes if not on
    
    This is relevant for fundamental mode and text mode.
---
 NEWS.org       | 3 +++
 indent-bars.el | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/NEWS.org b/NEWS.org
index 1c2adb63a9..b41cf67394 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -2,6 +2,9 @@
 #+author: J.D. Smith
 #+language: en
 
+* DEVELOPMENT
+- Enable font-lock in modes where it is not enabled (e.g. fundamental/text). 
+
 * v0.8.4 (2025-05-08)
 - =BUGFIX= avoid ~args-out-of-range~ errors in TS modes.
 
diff --git a/indent-bars.el b/indent-bars.el
index b9099b4ce3..b7c8d6b2d1 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -1663,7 +1663,9 @@ Adapted from `highlight-indentation-mode'."
                        (not (any ?\t ?\s ?\n)))
                       ;; group 2: multi-line blank regions
                       ,@(if indent-bars-display-on-blank-lines
-                            '((group (* (or ?\s ?\t ?\n)) ?\n))))))))
+                            '((group (* (or ?\s ?\t ?\n)) ?\n)))))))
+  (unless font-lock-defaults (setq font-lock-defaults t))
+  (unless font-lock-mode (font-lock-mode 1)))
 
 (declare-function indent-bars--ts-mode "indent-bars-ts")
 (defun indent-bars-setup ()

Reply via email to