fix(org): bounds for inline images in babel results

org-babel-result-end can return the wrong position if cursor is in a src
block (which is where it will be when org-babel-after-execute-hook
triggers).

Amend: 451be94fb8
This commit is contained in:
Henrik Lissner 2022-01-29 18:42:20 +01:00
parent 2c06577edf
commit 9dbdb854b9

View file

@ -314,9 +314,10 @@ Also adds support for a `:sync' parameter to override `:async'."
;; ...and not while tangling org buffers (which happens in a temp
;; buffer where `buffer-file-name' is nil).
(string-match-p "^ \\*temp" (buffer-name)))
(when-let ((beg (org-babel-where-is-src-block-result))
(end (org-babel-result-end)))
(org-display-inline-images nil nil (min beg end) (max beg end))))))
(save-excursion
(when-let ((beg (org-babel-where-is-src-block-result))
(end (progn (goto-char beg) (forward-line) (org-babel-result-end)))))
(org-display-inline-images nil nil (min beg end) (max beg end))))))
(after! python
(unless org-babel-python-command