Skip to content

Commit

Permalink
Go to end of source block before org-table-align
Browse files Browse the repository at this point in the history
This is necessary because otherwise blocks like this:
x
| x

Will turn into
x
| x

x
| x |

Since org-table-align will get called on | x, and turn it into | x |

I'm noticing this problem because of the automatic black formatting,
which frequently puts |'s at the start of lines.
  • Loading branch information
ElleNajt committed Feb 13, 2025
1 parent 2b9239d commit de196f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ob-python-extras.el
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ with open(exec_file, 'r') as file:
(save-excursion
(with-current-buffer (current-buffer)
(goto-char top-of-src-block)
(forward-line 1)
(if (re-search-forward "^#\\+end_src" nil t)
(forward-line 1)
())
(let ((in-table nil))
(while (and (= (forward-line) 0)
(not (looking-at "^[ \t]*:END:[ \t]*$")))
Expand Down

0 comments on commit de196f0

Please sign in to comment.