org-align-tags: Fix tag alignment in inlinetasks

* lisp/org.el (org-align-tags): Re-use 'line-prefix text property when
`org-indent-mode' is enabled.  The old version partially copy-pasted
the org-indent code and missed the new changes in inlinetask
alignment.  The new approach should be robust against future
org-indent changes.

Fixes https://orgmode.org/list/25334.19025.107017.390781@gargle.gargle.HOWL
This commit is contained in:
Ihor Radchenko 2022-08-13 14:28:55 +08:00
parent a0b8b7303b
commit ccca8549a2
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 6 additions and 2 deletions

View File

@ -11521,8 +11521,12 @@ visible part of the buffer."
(let ((get-indent-column
(lambda ()
(let ((offset (if (bound-and-true-p org-indent-mode)
(* (1- org-indent-indentation-per-level)
(1- (org-current-level)))
(save-excursion
(org-back-to-heading-or-point-min)
(length
(get-text-property
(line-end-position)
'line-prefix)))
0)))
(+ org-tags-column
(if (> org-tags-column 0) (- offset) offset))))))