branch: externals/valign
commit ced2f6a45ea40a2a2f27d955178a8f589fa6219c
Author: Yuan Fu <[email protected]>
Commit: Yuan Fu <[email protected]>
* valign.el (valign-table-1): Fix search term.
---
valign.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/valign.el b/valign.el
index b217e24..2242588 100644
--- a/valign.el
+++ b/valign.el
@@ -489,11 +489,13 @@ You need to restart valign mode for this setting to take
effect."
"Visually align the table at point."
(valign--beginning-of-table)
(let* ((space-width (save-excursion
- (search-forward " ")
+ (or (search-forward " " nil t)
+ (search-backward " " nil t))
(valign--pixel-width-from-to
(match-beginning 0) (match-end 0))))
(bar-width (save-excursion
- (search-forward "|")
+ (or (search-forward "|" nil t)
+ (search-backward "|" nil t))
(valign--pixel-width-from-to
(match-beginning 0) (match-end 0))))
(table-end (save-excursion (valign--end-of-table) (point)))