emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/valign 927d82d 041/198: Support indented tables


From: Stefan Monnier
Subject: [elpa] externals/valign 927d82d 041/198: Support indented tables
Date: Tue, 1 Dec 2020 18:19:12 -0500 (EST)

branch: externals/valign
commit 927d82d0196a7cd5f610886dd42bbd9aa18e5842
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Support indented tables
    
    * valign.el (valign--beginning-of-table, valign--end-of-table): skip
    white space characters at the beginning of a line.
---
 valign.el | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/valign.el b/valign.el
index 5af7ae1..bba3140 100644
--- a/valign.el
+++ b/valign.el
@@ -229,12 +229,16 @@ Start from point, stop at LIMIT."
 Assumes point is on a table.  Return nil if failed, point
 otherwise."
   (beginning-of-line)
+  (skip-chars-forward " \t")
   (if (not (eq (char-after) ?|))
       nil
     (while (eq (char-after) ?|)
-      (forward-line -1))
+      (forward-line -1)
+      (beginning-of-line)
+      (skip-chars-forward " \t"))
     (unless (eq (char-after) ?|)
-      (forward-line))
+      (search-forward "|")
+      (backward-char))
     (point)))
 
 (defun valign--end-of-table ()
@@ -242,11 +246,15 @@ otherwise."
 Assumes point is on a table.  Return nil if failed, point
 otherwise."
   (beginning-of-line)
+  (skip-chars-forward " \t")
   (if (not (eq (char-after) ?|))
       nil
     (while (eq (char-after) ?|)
-      (forward-line 1))
-    (backward-char)
+      (forward-line 1)
+      (beginning-of-line)
+      (skip-chars-forward " \t"))
+    (search-backward "|")
+    (forward-char)
     (point)))
 
 (defun valign--put-text-property (beg end xpos)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]