[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars e2a0274e8b 164/431: Make no-descend-string
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars e2a0274e8b 164/431: Make no-descend-string a local symbol for configuring string type |
Date: |
Mon, 16 Sep 2024 12:59:24 -0400 (EDT) |
branch: externals/indent-bars
commit e2a0274e8b46e08d21d2b12f4c0b086cbc515443
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
Make no-descend-string a local symbol for configuring string type
---
indent-bars.el | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index 4ecb65c2af..8b83d7f596 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -384,12 +384,12 @@ is set."
(repeat :tag "Node types" string))
:group 'indent-bars)
-(defcustom indent-bars-no-descend-string t
+(defcustom indent-bars-no-descend-string 'string
"Configure bar behavior inside strings.
-If non-nil, bars will go no deeper than their starting line
-inside multi-line strings. Strings are identified with
-tree-sitter; see `indent-bars-ts-string-type'."
- :type 'boolean
+If non-nil, set to a symbol naming a tree-sitter string node type into which
+bars will go no deeper than their starting line."
+ :local t
+ :type '(choice (const :tag "Disable" nil) (symbol :tag "Node Type"))
:group 'indent-bars)
;;;; Colors
@@ -820,7 +820,6 @@ see `indent-bars-prefer-character')."
'face (indent-bars--face d))))))))
;;;; Tree-sitter
-(defvar-local indent-bars-ts-string-type 'string)
(defvar-local indent-bars--ts-parser nil)
(defvar-local indent-bars--ts-query nil)
(defvar-local indent-bars--ts-string-query nil)
@@ -1128,10 +1127,6 @@ Adapted from `highlight-indentation-mode'."
(or (not (display-graphic-p)) indent-bars-prefer-character))
(indent-bars--create-no-stipple-chars 9)
- ;; Resize
- (add-hook 'text-scale-mode-hook #'indent-bars--resize-stipple nil t)
- (indent-bars--resize-stipple) ; just in case
-
;; Window state: selection/size
(add-hook 'window-state-change-functions #'indent-bars--window-change nil t)
@@ -1146,9 +1141,9 @@ Adapted from `highlight-indentation-mode'."
indent-bars--ts-query
(treesit-query-compile lang `([,@(mapcar #'list types)] @ctx)))
(when indent-bars-no-descend-string
- (setq indent-bars--ts-string-query
- (treesit-query-compile
- lang `([(,indent-bars-ts-string-type)] @s)))))
+ (let ((query `([(,indent-bars-no-descend-string)] @s)))
+ (setq indent-bars--ts-string-query
+ (treesit-query-compile lang query)))))
;; Current depth highlight
(when indent-bars-highlight-current-depth
@@ -1158,6 +1153,10 @@ Adapted from `highlight-indentation-mode'."
(setq indent-bars--current-depth 0)
(indent-bars--highlight-current-depth))
+ ;; Resize
+ (add-hook 'text-scale-mode-hook #'indent-bars--resize-stipple nil t)
+ (indent-bars--resize-stipple) ; just in case
+
;; Font-lock
(indent-bars--setup-font-lock)
(font-lock-flush))
- [elpa] externals/indent-bars 6192a63abe 066/431: README: fix stipple test, (continued)
- [elpa] externals/indent-bars 6192a63abe 066/431: README: fix stipple test, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 0ce041ed59 084/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 880236eb59 115/431: Use a compiled query-capture to find uppermost containing list, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 30a4a63f11 138/431: highlight-current-depth: use new ON-BAR capability for depth, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7957d7a2d3 135/431: draw-line: handle 1 bar case correctly, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bb857e344f 126/431: Use starting-column instead of a fixed spacing offset, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 3249aafe0d 152/431: Improve whatsnew, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 0638ba1ace 168/431: Customize the font weight of the no-stipple character, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars b0ba6ba4ba 147/431: handle-blank-lines: simplify, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars aa3d09ceff 173/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars e2a0274e8b 164/431: Make no-descend-string a local symbol for configuring string type,
ELPA Syncer <=
- [elpa] externals/indent-bars dca608724d 183/431: README: mention new depth highlight timer and config, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a618015bb5 145/431: Add treesit before/after images, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 581a51d3ae 150/431: README: improve features list and add blank/string treesit config, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars ce7fb0641c 189/431: refactoring treesitter to new file: initial stage, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 6df95da4b1 157/431: README.md: Use current defaults for first image, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 2d30dc37cc 206/431: indent-bars-ts: comment improvements, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d5f393ac4c 207/431: Add PCH for scope update, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 29b7bdc8f9 204/431: Return nil from font-lock face expression functions, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a282e1bbb8 238/431: use BEG+END for drawing rather than match boundaries, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 85fcf55464 210/431: Merge branch 'main' into treesit-scope, ELPA Syncer, 2024/09/16