branch: externals/indent-bars
commit 78ddecc3a806c81ff0073fd6851706eaffed05e6
Author: JD Smith <[email protected]>
Commit: JD Smith <[email protected]>
protect display with save-excursion
Font-lock does not always place point on the match line as it works.
---
indent-bars.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index ec8443b7c4..ec9af57113 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -883,9 +883,11 @@ Blank lines to ignore are those with types in
(defun indent-bars--display ()
"Display indentation bars based on line contents."
- (let ((b (match-beginning 1))
- (e (match-end 1))
- (n (indent-bars--current-indentation-depth)))
+ (let* ((b (match-beginning 1))
+ (e (match-end 1))
+ (n (save-excursion
+ (goto-char b)
+ (indent-bars--current-indentation-depth))))
(when (> n 0) (indent-bars--draw-line n b e)))
nil)