[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars dd4f7bd3ee 296/431: update-scope: consider
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars dd4f7bd3ee 296/431: update-scope: consider no node or scope match as full-file |
Date: |
Mon, 16 Sep 2024 12:59:43 -0400 (EDT) |
branch: externals/indent-bars
commit dd4f7bd3ee04f57b2657a3b8fd3adf31999767dc
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
update-scope: consider no node or scope match as full-file
Top level entities should have the entire file as scope.
---
indent-bars-ts.el | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/indent-bars-ts.el b/indent-bars-ts.el
index 11a1d7162e..2508c1c0ae 100644
--- a/indent-bars-ts.el
+++ b/indent-bars-ts.el
@@ -319,16 +319,19 @@ ranges and update. Note that the updated node range
clips to an
(= (buffer-modified-tick) (ibts/tick ibtcs))))
(setf (ibts/tick ibtcs) (buffer-modified-tick)
(ibts/point ibtcs) (point))
- (when-let ((node (treesit-node-on
- (max (point-min) (1- (point))) (point)
- indent-bars-ts--parser))
- (scope (indent-bars-ts--node-query
- node (ibts/query ibtcs) nil 'innermost
- indent-bars-treesit-scope-min-lines)))
+ (let* ((node (treesit-node-on
+ (max (point-min) (1- (point))) (point)
+ indent-bars-ts--parser))
+ (scope (and node
+ (indent-bars-ts--node-query
+ node (ibts/query ibtcs) nil 'innermost
+ indent-bars-treesit-scope-min-lines))))
(let* ((old (ibts/range ibtcs)) ;old node range markers
(old-clip (ibts/clip-win ibtcs)) ;old clipping window
(win (cons (window-start) (window-end)))
- (new (cons (treesit-node-start scope) (treesit-node-end scope))))
+ (new (if scope ; no scope = full file
+ (cons (treesit-node-start scope) (treesit-node-end scope))
+ (cons (point-min) (point-max)))))
(unless (and (= (car new) (car old)) ; if node spans the
(= (cdr new) (cdr old)) ; same positions and the
(>= (car win) (car old-clip)) ; window is inside old range:
@@ -342,8 +345,7 @@ ranges and update. Note that the updated node range clips
to an
(indent-bars--current-indentation-depth)))
(cl-loop for rng in (indent-bars-ts--union old new)
for (beg . end) = (indent-bars-ts--intersection rng
clip-wide)
- if (and beg end)
- do
+ if (and beg end) do
(message "Flushing %d lines" (count-lines beg end))
(font-lock-flush beg end))
(set-marker (car old) (car new))
- [elpa] externals/indent-bars c6f08762b2 273/431: Use min-lines 3 for TS scope, (continued)
- [elpa] externals/indent-bars c6f08762b2 273/431: Use min-lines 3 for TS scope, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d06e6e10da 268/431: Overhaul scope structure and logic, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bfcc3fac50 271/431: assign update-depth-function in :success clause, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d883507335 270/431: docs: improve update-scope1 docstring, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 10ce56b4e0 255/431: Improve stipple docstring and comment, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d7b56cf13f 284/431: Tweak PPSS logic, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d7c1bd96e4 287/431: use idle-timer for highlighted bar update too, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars e3ebe0d389 289/431: Remove window-state-change-functions hook on teardown, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars e12b91fe3f 295/431: doc: custom tweak, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 8855d462da 297/431: Add unspecified choice to simple custom vars too, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars dd4f7bd3ee 296/431: update-scope: consider no node or scope match as full-file,
ELPA Syncer <=
- [elpa] externals/indent-bars 93a268799d 307/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a78445ef7d 299/431: update copyrights, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d962712541 302/431: Update-name and relocate delay vars, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars def1e3e395 303/431: README: document v0.5 release, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 6a68c5e7ff 301/431: Bump version, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c4d05c62c0 306/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars f34bd21940 310/431: Tweak default bar style: slimmer bar, longer "dash:, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 2b6d25a083 316/431: update current indentation only if depth decreases, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars f6e96b01d2 312/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 449b49f6a1 331/431: Update README.md, ELPA Syncer, 2024/09/16