[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars bb857e344f 126/431: Use starting-column ins
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars bb857e344f 126/431: Use starting-column instead of a fixed spacing offset |
Date: |
Mon, 16 Sep 2024 12:59:20 -0400 (EDT) |
branch: externals/indent-bars
commit bb857e344f6fcbf28af366894532046fffb9455b
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
Use starting-column instead of a fixed spacing offset
---
indent-bars.el | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index 330e5548bd..9d238431fd 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -336,9 +336,12 @@ color to use for color blending in that case."
:type 'color
:group 'indent-bars)
-(defcustom indent-bars-skip-leftmost-column t
- "Whether to skip displaying a bar at the leftmost column."
- :type 'boolean
+(defcustom indent-bars-starting-column nil
+ "The starting column on which to display the first bar.
+Set to nil, for the default behavior (first bar at the first
+indent level) or an integer value for some other column."
+ :type '(choice (const :tag "Default: 1st indent position" nil)
+ (integer :tag "Specified column"))
:group 'indent-bars)
(defcustom indent-bars-spacing-override nil
@@ -574,9 +577,18 @@ font-lock properties."
(append '(display) font-lock-extra-managed-props)))
(funcall indent-bars-orig-unfontify-region beg end)))
-;;;; Display
+;;;; Indentation
(defvar-local indent-bars-spacing nil)
+(defvar-local indent-bars--offset nil)
+(defsubst indent-bars--depth (len)
+ "Number of possible bars for initial blank string of length LEN.
+Note that the first bar is expected at `indent-bars-starting-column'."
+ (setq len (- len indent-bars--offset))
+ (cond ((>= len indent-bars-spacing) (/ (1+ len) indent-bars-spacing))
+ ((> len 0) 1)
+ (t 0)))
+;;;; Display
(defsubst indent-bars--block (n)
"Create a block of N low-order 1 bits."
(- (ash 1 n) 1))
@@ -1101,7 +1113,8 @@ Adapted from `highlight-indentation-mode'."
(defun indent-bars-setup ()
"Setup all face, color, bar size, and indentation info for the current
buffer."
;; Spacing
- (setq indent-bars-spacing (indent-bars--guess-spacing))
+ (setq indent-bars-spacing (indent-bars--guess-spacing)
+ indent-bars--offset (or indent-bars-starting-column
indent-bars-spacing))
;; Colors
(setq indent-bars--main-color (indent-bars--main-color)
- [elpa] externals/indent-bars 3bffb21456 111/431: Correct custom name for no-descend-string, (continued)
- [elpa] externals/indent-bars 3bffb21456 111/431: Correct custom name for no-descend-string, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars f9558953b2 083/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 674b9d4b75 073/431: bump version, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 138bbab23f 106/431: Update examples.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars cc1a3143cb 113/431: Calc blank line current-indent at beginning of prior line, ELPA Syncer, 2024/09/16
- [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 <=
- [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, 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