[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars a282e1bbb8 238/431: use BEG+END for drawing
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars a282e1bbb8 238/431: use BEG+END for drawing rather than match boundaries |
Date: |
Mon, 16 Sep 2024 12:59:32 -0400 (EDT) |
branch: externals/indent-bars
commit a282e1bbb89d180e81ce1ad652f3f9ca58dff4d2
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
use BEG+END for drawing rather than match boundaries
---
indent-bars.el | 43 +++++++++++++++++++------------------------
1 file changed, 19 insertions(+), 24 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index 63705ae5d4..0400cdbf77 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -1075,19 +1075,14 @@ font-lock properties."
(append '(display) font-lock-extra-managed-props)))
(funcall indent-bars-orig-unfontify-region beg end)))
-(defun indent-bars--display (&optional style switch-after style2)
- "Draw indentation bars based on line contents.
-STYLE, SWITCH-AFTER and STYLE2 are as in
-`indent-bars--draw-line'. If STYLE is not passed, uses
-`indent-bars-style' for drawing."
- (let* ((b (match-beginning 1))
- (e (match-end 1))
- (n (save-excursion
- (goto-char b)
- (indent-bars--current-indentation-depth))))
- (when (> n 0) (indent-bars--draw-line style n b e nil
- switch-after style2))
- nil))
+(defun indent-bars--display (beg end &optional style switch-after style2)
+ "Draw indentation bars from BEG..END, based on line contents.
+BEG and END should be on the same line. STYLE, SWITCH-AFTER and
+STYLE2 are as in `indent-bars--draw-line'. If STYLE is not
+passed, uses `indent-bars-style' for drawing."
+ (let* ((n (indent-bars--current-indentation-depth)))
+ (when (> n 0) (indent-bars--draw-line style n beg end nil
+ switch-after style2))))
(defsubst indent-bars--context-bars (end)
"Maximum number of bars at point and END.
@@ -1097,21 +1092,21 @@ Moves point."
(goto-char (1+ end)) ; end is always eol
(indent-bars--current-indentation-depth))))
-(defun indent-bars--handle-blank-lines (&optional style switch-after style2)
- "Display the appropriate bars on regions of one or more blank-only lines.
-The region is the full match region of the last match. Only
-called by font-lock if `indent-bars-display-on-blank-lines' is
-non-nil. Called on complete multi-line blank line regions. Uses
-the surrounding line indentation to determine additional bars to
-display on each line, using `indent-bars--draw-line'. STYLE,
-SWITCH-AFTER and STYLE2 are as in `indent-bars--draw-line'.
+(defun indent-bars--handle-blank-lines (beg end &optional style switch-after
style2)
+ "Display the appropriate bars over the blank-only lines from BEG..END.
+Only called if `indent-bars-display-on-blank-lines' is non-nil.
+To be called on complete multi-line blank line regions.
+
+It is ambigious how many bars to draw on each line in a stretch
+of blank lines, so this uses the maximum depth of the surrounding
+line indentation, above and below. Drawing using
+`indent-bars--draw-line'. STYLE, SWITCH-AFTER and STYLE2 are as
+in `indent-bars--draw-line'.
Note: blank lines at the very beginning or end of the buffer are
not indicated, even if they otherwise would be. This function is
configured by default in `indent-bars--handle-blank-lines-form'."
- (let* ((beg (match-beginning 0))
- (end (match-end 0))
- ctxbars)
+ (let (ctxbars)
(save-excursion
(goto-char (1- beg))
(beginning-of-line 1)
- [elpa] externals/indent-bars aa3d09ceff 173/431: Update README.md, (continued)
- [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, 2024/09/16
- [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 <=
- [elpa] externals/indent-bars 85fcf55464 210/431: Merge branch 'main' into treesit-scope, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 2a8cf5a2fa 243/431: Major refactor for STYLE stipple face & support, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 13cebfa12f 229/431: Merge pull request #37 from gekoke/gekoke/nixlang-indentation, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 6116ab7468 263/431: Correctly remove remaps from plists, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 1f575f2404 211/431: Remove unused ts--scope-query, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars b0c138ce17 256/431: teardown whr win-param but not global faces, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars ac949f347e 260/431: Remove unnecessary cleanup on update-all-stipples, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 916dc89ce9 261/431: Do not trust indent-bars-whr window parameter absolutely, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7e0493f157 280/431: Store and check bol not point; no scope recompute on same line, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 75498edc35 281/431: docstrings: custom vars, ELPA Syncer, 2024/09/16