[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars edab5ee530 203/431: Comment/docstring impro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars edab5ee530 203/431: Comment/docstring improvements |
Date: |
Mon, 16 Sep 2024 12:59:29 -0400 (EDT) |
branch: externals/indent-bars
commit edab5ee530a65934cabf1237e1226ee8c7ddd0e8
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
Comment/docstring improvements
---
indent-bars-ts.el | 22 +++++++++++-----------
indent-bars.el | 3 ---
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/indent-bars-ts.el b/indent-bars-ts.el
index 1956aea24f..ef2cf291c2 100644
--- a/indent-bars-ts.el
+++ b/indent-bars-ts.el
@@ -21,6 +21,7 @@
;; ibts/ => indent-bars-ts-scope- (slot accessors)
;; ibtcs => indent-bars-ts-current-scope (struct)
+;;; Code:
;;;; Requires
(require 'cl-lib)
@@ -183,6 +184,7 @@ arguments)."
d))
;;;; Ignoring Certain Blank Lines
+;; see also ts--handle-blank-lines, below
(defun indent-bars-ts--ignore-blank (beg)
"See if blank lines at BEG should be ignored using tree-sitter.
Blank lines to ignore are those within nodes of the types
@@ -193,8 +195,6 @@ mentioned in
`indent-bars-treesit-ignore-blank-lines-types'."
(seq-contains-p indent-bars-treesit-ignore-blank-lines-types
(treesit-node-type n)))))
-;; see also ts--handle-blank-lines, below
-
;;;; Scope Highlighting
(defvar indent-bars-ts-out-scope-style nil)
(cl-declaim (optimize (safety 0))) ; no need for type check
@@ -216,26 +216,27 @@ scope."
(and ibtcs (or (< pos (ibts/start ibtcs)) (> pos (ibts/end ibtcs)))))
(defun indent-bars-ts--display ()
- "Display indentation bars accounting for current treesitter scope."
+ "Display indentation bars, accounting for current treesitter scope."
(if (indent-bars-ts--out-of-scope (match-beginning 1))
- (indent-bars--display indent-bars-ts-out-scope-style) ; fully faded, or
- (indent-bars--display indent-bars-ts-out-scope-style ; switch from
- (ibts/start-bars ibtcs) ; faded to normal
+ (indent-bars--display indent-bars-ts-out-scope-style)
+ (indent-bars--display indent-bars-ts-out-scope-style
+ (ibts/start-bars ibtcs)
indent-bars-style)))
(defun indent-bars-ts--handle-blank-lines ()
"Display bars on blank lines, respecting treesitter scope."
(let ((beg (match-beginning 0)))
(unless (indent-bars-ts--ignore-blank beg)
- (if (indent-bars-ts--out-of-scope beg) ;fully faded
+ (if (indent-bars-ts--out-of-scope beg) ;fully out of scope
(indent-bars--handle-blank-lines indent-bars-ts-out-scope-style)
+ ;; Switch from out of scope to in scope after start-bars
(indent-bars--handle-blank-lines indent-bars-ts-out-scope-style
(ibts/start-bars ibtcs)
indent-bars-style)))))
(defun indent-bars-ts--symdiff (a b)
"Return the symmetric difference between ranges A and B.
-A and B ranges of (start . end) conses. Their symmetric
+Ranges A and B are (start . end) conses. Their symmetric
difference is a list of ranges, possibly nil, that one (but not
both) of them cover."
(let ((l '()))
@@ -257,12 +258,11 @@ both) of them cover."
"Perform the treesitter scope update.
If the buffer is modified or the point has moved, re-query the
scope bounds. If it has changed (beyond normal marker movement),
-refontify the symmetric difference between old and new
+refontify the symmetric difference between the old and new
ranges (i.e those ranges covered by either old or new, but not
both)."
(unless (and (= (point) (ibts/point ibtcs))
(= (buffer-modified-tick) (ibts/tick ibtcs)))
- ;; scope may have changed
(when-let ((node (treesit-node-on
(max (point-min) (1- (point))) (point)
indent-bars-ts--parser))
@@ -282,7 +282,7 @@ both)."
(indent-bars--current-indentation-depth)))
(set-marker (ibts/start ibtcs) tsc-start)
(set-marker (ibts/end ibtcs) tsc-end)
- (cl-loop for (beg . end) in ; refontify
+ (cl-loop for (beg . end) in ; refontify where needed
(indent-bars-ts--symdiff
(cons old-start old-end) (cons tsc-start tsc-end))
do (font-lock-flush beg end)))))))
diff --git a/indent-bars.el b/indent-bars.el
index e147dfdfb6..239fc12940 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -1040,9 +1040,6 @@ font-lock properties."
(append '(display) font-lock-extra-managed-props)))
(funcall indent-bars-orig-unfontify-region beg end)))
-;; local variables to be dynamically bound
-(defvar-local indent-bars--switch-after nil)
-
(defun indent-bars--display (&optional style switch-after style2)
"Draw indentation bars based on line contents.
STYLE, SWITCH-AFTER and STYLE2 are as in
- [elpa] externals/indent-bars 2b0a4ad168 165/431: no-descend-string: explicitly test string query for validity, (continued)
- [elpa] externals/indent-bars 2b0a4ad168 165/431: no-descend-string: explicitly test string query for validity, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 62c76468eb 202/431: Merge branch 'main' into treesit-scope, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 6e2f93d194 193/431: ib: improve docs and add shorthands, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a195a06b8c 185/431: Correctly call run-at-time, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars ee36aa78ae 192/431: ts: emphasis scope algorithm added, with struct shorthands, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars f2d9c0f95b 188/431: Improve documentation, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars acb9ded166 178/431: docstring and comment improvements, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d4ea40e3bb 195/431: relabel faded -> out-of-scope, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 09b972f957 156/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 9cf88e1403 176/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars edab5ee530 203/431: Comment/docstring improvements,
ELPA Syncer <=
- [elpa] externals/indent-bars ce84791086 208/431: Teardown TS forms and PCH on main mode teardown, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 902713b115 198/431: create new -form vars for font-lock keyword callback flexibility, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 4d4f041cfc 205/431: Make sure beg/end markers point somewhere, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a6dbf67f74 245/431: Section rename/unused var cleanup, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars fffa4fe52d 236/431: Tweak remap removal., ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 19dd505850 242/431: Reorg stipple display section, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 08fbce35de 214/431: Move treesitter setup above resize (which uses it), ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 070ab26c6d 197/431: new 'force option for init-scope, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 4583e3e9f5 240/431: Add reset to enable-theme-functions, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 301c97550b 219/431: Correctly initialize 'color alt custom (unspecified), ELPA Syncer, 2024/09/16