branch: externals/valign
commit 09e89aa134adf67c57c28745e9761334d3aea828
Author: Yuan Fu <[email protected]>
Commit: Yuan Fu <[email protected]>
* valign.el (valign--at-table-p): Don’t align org blocks.
---
valign.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/valign.el b/valign.el
index 0f1d6de..ad117b1 100644
--- a/valign.el
+++ b/valign.el
@@ -287,7 +287,13 @@ Start from point, stop at LIMIT."
"Return non-nil if point is in a table."
(save-excursion
(beginning-of-line)
- (looking-at "[ \t]*|")))
+ (let ((face (plist-get (text-properties-at (point)) 'face)))
+ ;; Don’t align tables in org blocks.
+ (and (looking-at "[ \t]*|")
+ (not (and (consp face)
+ (or (equal face '(org-block))
+ (equal (plist-get face :inherit)
+ '(org-block)))))))))
(defun valign--beginning-of-table ()
"Go backward to the beginning of the table at point.