[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/valign ba7a72b 110/198: * valign.el (valign-table): Tuc
From: |
Stefan Monnier |
Subject: |
[elpa] externals/valign ba7a72b 110/198: * valign.el (valign-table): Tuck in some long lines. |
Date: |
Tue, 1 Dec 2020 18:19:28 -0500 (EST) |
branch: externals/valign
commit ba7a72beb7ac140bd1ee0c95115b754db43b9423
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
* valign.el (valign-table): Tuck in some long lines.
---
valign.el | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/valign.el b/valign.el
index 12fbad8..783da96 100644
--- a/valign.el
+++ b/valign.el
@@ -514,12 +514,13 @@ You need to restart valign mode for this setting to take
effect."
(signal 'valign-not-gui nil))
(let (end column-width-list column-idx pos ssw bar-width
separator-row-point-list rev-list
- column-alignment-list info at-sep-row right-bar-pos)
+ column-alignment-list info at-sep-row
+ right-bar-pos)
;; ‘separator-row-point-list’ marks the point for each
;; separator-row, so we can later come back and align them.
- ;; ‘rev-list’ is the reverse list of right positions of each
- ;; separator row cell. ‘at-sep-row’ t means we are at
- ;; a separator row.
+ ;; ‘rev-list’ is the reverse list of right positions of
+ ;; each separator row cell. ‘at-sep-row’ t means we
+ ;; are at a separator row.
(if (not (valign--at-table-p))
(signal 'valign-not-on-table nil))
(valign--end-of-table)
@@ -551,9 +552,10 @@ You need to restart valign mode for this setting to take
effect."
;; single-space-width
(unless ssw (setq ssw (valign--pixel-width-from-to
(point) (1+ (point)))))
- (unless bar-width (setq bar-width
- (valign--pixel-width-from-to
- (1- (point)) (point))))
+ (unless bar-width
+ (setq bar-width
+ (valign--pixel-width-from-to
+ (1- (point)) (point))))
;; Initialize some numbers when we are at a new
;; line. ‘pos’ is the pixel position of the
;; current point, i.e., after the left bar.
@@ -564,7 +566,8 @@ You need to restart valign mode for this setting to take
effect."
(valign--maybe-render-bar (1- (point)))
(unless (valign--separator-p)
(setq rev-list nil))
- (setq at-sep-row (if (valign--separator-p) t nil))
+ (setq at-sep-row
+ (if (valign--separator-p) t nil))
(setq pos (valign--pixel-width-from-to
(line-beginning-position) (point))))
;; Align cell.
@@ -574,7 +577,8 @@ You need to restart valign mode for this setting to take
effect."
(valign--skip-space-forward)
(if (< (- (point) tab-start) 2)
(valign--put-text-property
- tab-start (point) (+ pos col-width ssw))
+ tab-start (point)
+ (+ pos col-width ssw))
;; When possible, we try to add two tabs
;; and the point can appear in the middle
;; of the cell, instead of on the very
@@ -586,13 +590,15 @@ You need to restart valign mode for this setting to take
effect."
(valign--put-text-property
(1+ tab-start) (point)
(+ pos col-width ssw))))
- ;; 2) Separator row. We don’t align the separator
- ;; row yet, but will come back to it.
+ ;; 2) Separator row. We don’t align the
+ ;; separator row yet, but will come back to
+ ;; it.
((valign--separator-p) nil)
;; 3) Normal cell.
(t (pcase (valign--cell-alignment
(valign--guess-table-type)
- (nth column-idx column-alignment-list))
+ (nth column-idx
+ column-alignment-list))
;; 3.1) Align a left-aligned cell.
('left (search-forward "|" nil t)
(backward-char)
@@ -618,7 +624,8 @@ You need to restart valign mode for this setting to take
effect."
valign-separator-row-style
(reverse rev-list)))))
- ((debug valign-bad-cell valign-not-gui valign-not-on-table) nil)))
+ ((debug valign-bad-cell valign-not-gui valign-not-on-table)
+ nil)))
;;; Mode intergration
- [elpa] externals/valign 82566b3 080/198: Fix tab calculation, (continued)
- [elpa] externals/valign 82566b3 080/198: Fix tab calculation, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 6578fe4 081/198: * valign.el (valign-table): Don’t message errors., Stefan Monnier, 2020/12/01
- [elpa] externals/valign e2a2a85 085/198: Rework hooks, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 44651e9 086/198: * valign.el (valign-mode): Change text-scale hooks., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 8b6ce8c 084/198: * valign.el (valign--cell-width): Minor change., Stefan Monnier, 2020/12/01
- [elpa] externals/valign dcf6bd8 088/198: Add force align, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 53be5d7 089/198: Add fancy bar, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 98eae8d 090/198: * valign.el (valign-table): Remove setter for custom option., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 159ae0f 102/198: Fix typo, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 1a614d2 101/198: Add missing with-silent-modifications form, Stefan Monnier, 2020/12/01
- [elpa] externals/valign ba7a72b 110/198: * valign.el (valign-table): Tuck in some long lines.,
Stefan Monnier <=
- [elpa] externals/valign ea71f38 126/198: * valign.el (valign-fancy-bar): Fix typo., Stefan Monnier, 2020/12/01
- [elpa] externals/valign cb95dc1 119/198: Separate valign--do-table, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 237293b 140/198: Change signal-catch to if-else, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 9554e4b 123/198: Clean up valign-table-1, Stefan Monnier, 2020/12/01
- [elpa] externals/valign a8d93c5 145/198: Fix markdown table alignment, Stefan Monnier, 2020/12/01
- [elpa] externals/valign a68750a 114/198: * valign.el (valign-table): Add missing docstring., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 70b3004 141/198: * valign.el (valign-table-1): Minor change., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 59dfb21 115/198: * valign.el (valign--fancy-bar-cursor-fn): Thinner bar when cursor is bar., Stefan Monnier, 2020/12/01
- [elpa] externals/valign 07585a7 142/198: Change advice, Stefan Monnier, 2020/12/01
- [elpa] externals/valign 9033d3b 128/198: Replace text property with overlay, Stefan Monnier, 2020/12/01