emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/indent-bars 71b787c7d0 294/431: display: goto BEG prior


From: ELPA Syncer
Subject: [elpa] externals/indent-bars 71b787c7d0 294/431: display: goto BEG prior to checking indentation depth
Date: Mon, 16 Sep 2024 12:59:42 -0400 (EDT)

branch: externals/indent-bars
commit 71b787c7d07c18eec5a60a334c3310fb16659c04
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>

    display: goto BEG prior to checking indentation depth
    
    This is necessary because font-lock puts point after the first
    non-blank character on the line, potentially changing the PPSS
    output (e.g. inside a string).
---
 indent-bars.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indent-bars.el b/indent-bars.el
index 8bb0da54aa..f04ef5fc0a 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -1072,7 +1072,9 @@ font-lock properties."
 BEG and END should be on the same line.  STYLE, SWITCH-AFTER and
 STYLE2 are as in `indent-bars--draw-line'.  If STYLE is not
 passed, uses `indent-bars-style' for drawing."
-  (let ((n (indent-bars--current-indentation-depth)))
+  (let ((n (save-excursion
+            (goto-char beg)
+            (indent-bars--current-indentation-depth))))
     (when (> n 0) (indent-bars--draw-line style n beg end nil
                                          switch-after style2))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]