branch: externals/valign
commit a04e1e707d43eeeb184389b057df6740065af9e9
Author: Yuan Fu <[email protected]>
Commit: Yuan Fu <[email protected]>
* valign.el (valign--beginning-of-table): Fix infinite loop.
---
valign.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/valign.el b/valign.el
index 97daf84..76428b8 100644
--- a/valign.el
+++ b/valign.el
@@ -290,10 +290,13 @@ Start from point, stop at LIMIT."
Assumes point is on a table."
(beginning-of-line)
(let ((p (point)))
- (while (looking-at "[ \t]*|")
- (setq p (point))
- (forward-line -1)
- (beginning-of-line))
+ (catch 'abort
+ (while (looking-at "[ \t]*|")
+ (setq p (point))
+ (if (eq (point) (point-min))
+ (throw 'abort nil))
+ (forward-line -1)
+ (beginning-of-line)))
(goto-char p)))
(defun valign--end-of-table ()