[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars c4495d8bf3 099/431: Re-organize stipple
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars c4495d8bf3 099/431: Re-organize stipple |
Date: |
Mon, 16 Sep 2024 12:59:17 -0400 (EDT) |
branch: externals/indent-bars
commit c4495d8bf3782cb86f2dba9c128a0742be58b9c7
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
Re-organize stipple
---
indent-bars.el | 74 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index c2fc834da7..ab63129eea 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -509,43 +509,6 @@ font-lock properties."
(append '(display) font-lock-extra-managed-props)))
(funcall indent-bars-orig-unfontify-region beg end)))
-;;;; No stipple (e.g. terminal)
-(defvar indent-bars--no-stipple-chars nil)
-;; (defvar indent-bars--no-stipple-current-depth-char nil)
-
-(defun indent-bars--no-stipple-char (depth)
- "Return the no-stipple bar character for DEPTH."
- (if (> depth (length indent-bars--no-stipple-chars))
- (indent-bars--create-no-stipple-chars depth))
- (aref indent-bars--no-stipple-chars (1- depth)))
-
-(defun indent-bars--create-no-stipple-chars (num)
- "Setup bar characters for bar faces up to depth NUM.
-Used when not using stipple display (on terminal, or by request;
-see `indent-bars-prefer-character')."
- (setq indent-bars--no-stipple-chars
- (vconcat
- (nreverse
- (cl-loop with l = (length indent-bars--no-stipple-chars)
- for d from num downto 1
- collect
- (or (and (< d l) (aref indent-bars--no-stipple-chars (1-
d)))
- (propertize (string indent-bars-no-stipple-char)
- 'face (indent-bars--face d))))))))
-
-(defun indent-bars--no-stipple-blank-string (off nbars bar-from)
- "Return a string suitable for blank line display without stipple.
-OFF is character offset for the first guide, NBARS is the desired
-number of bars to add, and BAR-FROM is the starting index of the
-first bar (>=1)"
- (concat (make-string off ?\s)
- (cl-loop with sps = (make-string (1- indent-bars-spacing) ?\s)
- concat (indent-bars--no-stipple-char depth)
- for depth from bar-from to (+ bar-from nbars -2)
- concat sps)
- "\n"))
-
-
;;;; Display
(defvar-local indent-bars-spacing nil)
@@ -707,6 +670,43 @@ returned."
(or (not (display-graphic-p))
indent-bars-prefer-character)))
nil)
+;;;; No stipple (e.g. terminal)
+(defvar indent-bars--no-stipple-chars nil)
+;; (defvar indent-bars--no-stipple-current-depth-char nil)
+
+(defun indent-bars--no-stipple-char (depth)
+ "Return the no-stipple bar character for DEPTH."
+ (if (> depth (length indent-bars--no-stipple-chars))
+ (indent-bars--create-no-stipple-chars depth))
+ (aref indent-bars--no-stipple-chars (1- depth)))
+
+(defun indent-bars--create-no-stipple-chars (num)
+ "Setup bar characters for bar faces up to depth NUM.
+Used when not using stipple display (on terminal, or by request;
+see `indent-bars-prefer-character')."
+ (setq indent-bars--no-stipple-chars
+ (vconcat
+ (nreverse
+ (cl-loop with l = (length indent-bars--no-stipple-chars)
+ for d from num downto 1
+ collect
+ (or (and (< d l) (aref indent-bars--no-stipple-chars (1-
d)))
+ (propertize (string indent-bars-no-stipple-char)
+ 'face (indent-bars--face d))))))))
+
+(defun indent-bars--no-stipple-blank-string (off nbars bar-from)
+ "Return a string suitable for blank line display without stipple.
+OFF is character offset for the first guide, NBARS is the desired
+number of bars to add, and BAR-FROM is the starting index of the
+first bar (>=1)"
+ (concat (make-string off ?\s)
+ (cl-loop with sps = (make-string (1- indent-bars-spacing) ?\s)
+ concat (indent-bars--no-stipple-char depth)
+ for depth from bar-from to (+ bar-from nbars -2)
+ concat sps)
+ "\n"))
+
+
;;;; Font Lock
(defvar-local indent-bars--font-lock-keywords nil)
(defvar indent-bars--font-lock-blank-line-keywords nil)
- [elpa] externals/indent-bars c534bb5b5d 056/431: Minor README tweak, (continued)
- [elpa] externals/indent-bars c534bb5b5d 056/431: Minor README tweak, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a9381135ff 051/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 9f03b2183b 055/431: Require compat, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 1cd0c30ba3 049/431: Tweaks to README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 628d42f204 072/431: Defer setup when running under daemon and remove from README, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 568ec43b0e 109/431: Correct quote in docstring to silence compiler, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 90e5616e8b 117/431: Handle tree-sitter configured but not available in buffer, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 57183c26e6 114/431: highlight-current-depth: guard against missing current-depth, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 9d225884fc 104/431: Improve blend commentary for current depth color, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7e28454459 076/431: include final newline to ensure full blank line regions match, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c4495d8bf3 099/431: Re-organize stipple,
ELPA Syncer <=
- [elpa] externals/indent-bars d59d94d622 088/431: 2nd attempt defer setup when running under daemon, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 44621a1a9b 087/431: Revert "Defer setup when running under daemon and remove from README", ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 945418c86d 112/431: current-indentation-depth: fallback to naive indent, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 929a5e2445 129/431: Major re-factoring of bar display: tabs, offset, and invent, more, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 529854ec34 170/431: Relocate :weight spec to indent-bars-stipple face, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bce0b729cc 130/431: Comment treesit, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d9459a784e 160/431: treesit improvements: always search from root node, add start-only, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bbdbbfe4da 159/431: Mention Carbon in versoin for emacs-mac, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 35bade62bd 179/431: do not use derived-mode-class, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 78ddecc3a8 153/431: protect display with save-excursion, ELPA Syncer, 2024/09/16