[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars b3297d6739 118/431: indent-at-node: move po
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars b3297d6739 118/431: indent-at-node: move point (guard at top level with save-excursion) |
Date: |
Mon, 16 Sep 2024 12:59:19 -0400 (EDT) |
branch: externals/indent-bars
commit b3297d6739b34659ccdefab61a96246cfd8c1059
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
indent-at-node: move point (guard at top level with save-excursion)
To improve efficiency, do not save-excursion for each call.
---
indent-bars.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index 744e77ee6c..99cc38e96b 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -719,9 +719,10 @@ returned."
(defvar indent-bars--string-content "string_content")
(defsubst indent-bars--indent-at-node (node)
- "Return the current indentation at the start of NODE."
- (save-excursion (goto-char (treesit-node-start node))
- (current-indentation)))
+ "Return the current indentation at the start of NODE.
+Moves point."
+ (goto-char (treesit-node-start node))
+ (current-indentation))
(defun indent-bars--current-indentation-depth ()
"Calculate current indentation depth.
@@ -732,6 +733,8 @@ depth to the parent node's, plus one. If
`indent-bars-no-descend-string' is non-nil, look for enclosing
string and mark indent depth no deeper than one more than the
starting line's depth."
+enclosing string and mark indent depth no deeper than one more
+than the starting line's depth. May move point."
(let* ((d (/ (current-indentation) indent-bars-spacing))
(p (point)))
(or
@@ -881,7 +884,7 @@ ROT are as in `indent-bars--stipple', and have similar
default values."
(defun indent-bars--highlight-current-depth ()
"Refresh current indentation depth highlight.
Works by remapping the appropriate indent-bars-N face."
- (let ((depth (indent-bars--current-indentation-depth)))
+ (let ((depth (save-excursion (indent-bars--current-indentation-depth))))
(when (and depth (not (= depth indent-bars--current-depth)))
(if indent-bars--remap-face ; out with the old
(face-remap-remove-relative indent-bars--remap-face))
- [elpa] externals/indent-bars 6ace473d05 121/431: README: document treesitter support, (continued)
- [elpa] externals/indent-bars 6ace473d05 121/431: README: document treesitter support, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a0d78b2c3d 065/431: Merge pull request #2 from BrunodaSilvaBelo/patch-1, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars e8cc5c4a77 094/431: Make default highlight bolder, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d8ee83c12d 063/431: Fix footnote, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars acb992d370 103/431: Mention ┋, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 3a971623af 102/431: Tweak README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a3083e769d 061/431: Merge pull request #1 from ideasman42/patch-2, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d23ab840ec 062/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 4a7f9c7528 059/431: README: more compatibility detail, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 25e3624ec1 108/431: initial support for treesitter + no string/comment descend, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars b3297d6739 118/431: indent-at-node: move point (guard at top level with save-excursion),
ELPA Syncer <=
- [elpa] externals/indent-bars b913264e5a 167/431: highlight-current-depth: add palette (no blending), ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 5bce1c1324 005/431: Notes on updates :stipple usage given gutter offsets, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars ee18d37d12 006/431: Greatly simplify row-data, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 3fef0ab598 007/431: improve stipple description comment, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 14dad9430e 011/431: spacing: use override and default to 4 chars, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 563328e19e 009/431: resize-stipple: let faces extend, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars fde60a178f 013/431: tint the main color with depth-based color first, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 257b723c72 014/431: Use stipple-rot for rotating stipple, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 2452b96761 021/431: Simplify create-faces, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 00a26de005 020/431: rename indentation->depth, ELPA Syncer, 2024/09/16