[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars d9459a784e 160/431: treesit improvements: a
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars d9459a784e 160/431: treesit improvements: always search from root node, add start-only |
Date: |
Mon, 16 Sep 2024 12:59:24 -0400 (EDT) |
branch: externals/indent-bars
commit d9459a784e0f41e543b4f79f1c17488b8f864975
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
treesit improvements: always search from root node, add start-only
For string search, since query finds matching nodes which overlap in
any manner with the range specified, start-only means to use a null
range start-start, to ensure the matched item is not a sub-unit/child
of the node.
---
indent-bars.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index ec9af57113..2dbba3955d 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -825,12 +825,15 @@ see `indent-bars-prefer-character')."
(defvar-local indent-bars--ts-query nil)
(defvar-local indent-bars--ts-string-query nil)
-(defsubst indent-bars--ts-node-query (node query)
+(defsubst indent-bars--ts-node-query (node query &optional start-only)
"Capture node(s) spanning NODE matching QUERY.
-QUERY is a compiled treesit query."
- (treesit-query-capture
- indent-bars--ts-parser query
- (treesit-node-start node) (treesit-node-end node) t))
+QUERY is a compiled treesit query. If START-ONLY is non-nil, the
+query searches for matching nodes spanning the start of the node
+at point."
+ (let* ((start (treesit-node-start node))
+ (end (if start-only start (treesit-node-end node))))
+ (treesit-query-capture (treesit-buffer-root-node) query
+ start end t)))
(defsubst indent-bars--indent-at-node (node)
"Return the current indentation at the start of NODE."
@@ -857,7 +860,7 @@ than the starting line's depth."
(node (treesit-node-on (1- p) p
indent-bars--ts-parser)))
(if (and indent-bars-no-descend-string
(indent-bars--ts-node-query
- node indent-bars--ts-string-query))
+ node indent-bars--ts-string-query t))
(1+ (indent-bars--depth (indent-bars--indent-at-node
node)))
(when-let ((ctx (indent-bars--ts-node-query
node indent-bars--ts-query)))
- [elpa] externals/indent-bars 57183c26e6 114/431: highlight-current-depth: guard against missing current-depth, (continued)
- [elpa] externals/indent-bars 57183c26e6 114/431: highlight-current-depth: guard against missing current-depth, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 9d225884fc 104/431: Improve blend commentary for current depth color, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7e28454459 076/431: include final newline to ensure full blank line regions match, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c4495d8bf3 099/431: Re-organize stipple, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d59d94d622 088/431: 2nd attempt defer setup when running under daemon, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 44621a1a9b 087/431: Revert "Defer setup when running under daemon and remove from README", ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 945418c86d 112/431: current-indentation-depth: fallback to naive indent, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 929a5e2445 129/431: Major re-factoring of bar display: tabs, offset, and invent, more, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 529854ec34 170/431: Relocate :weight spec to indent-bars-stipple face, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bce0b729cc 130/431: Comment treesit, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d9459a784e 160/431: treesit improvements: always search from root node, add start-only,
ELPA Syncer <=
- [elpa] externals/indent-bars bbdbbfe4da 159/431: Mention Carbon in versoin for emacs-mac, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 35bade62bd 179/431: do not use derived-mode-class, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 78ddecc3a8 153/431: protect display with save-excursion, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 6f886f89c4 141/431: Support go-mode in addition to go-ts-mode, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 3c83532f98 182/431: Bump version, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 1875deadb7 166/431: Report TS string query error, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 20e34365e9 191/431: ts: improved query setup, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 2e0e6ee0fd 196/431: add support for ts start-bars to switch from oos to emph w/in line, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a4d43c0054 163/431: README: FAQ starting-column, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7b6454d6e8 190/431: ts.el: improve docs and customization options, ELPA Syncer, 2024/09/16