emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-src-font-lock-fontify-block is unaware of org-edit-src-content-


From: Ihor Radchenko
Subject: Re: org-src-font-lock-fontify-block is unaware of org-edit-src-content-indentation, leading to fontification issues
Date: Mon, 13 Nov 2023 08:37:42 +0000

JD Smith <jdtsmith@gmail.com> writes:

> When `org-edit-src-content-indentation’ is non-nil (default: 2), editing SRC 
> blocks preserves this amount of extra indentation space at the beginning of 
> each line of the block, removing and then re-adding it on round trips through 
> `org-edit-src-code’.
>
> But `org-src-font-lock-fontify-block' does not consider this extra space. 
> Instead it simply copies the full block verbatim into e.g.  
> *org-src-fontification:python-mode*, as if the extra indent space were a 
> legitimate part of the source.  Normally this wouldn’t be a problem, as faces 
> are attached to keywords.  But for any fontification that depends explicitly 
> on indentation, this leads to incorrect results.  For example, my indent-bars 
> package adds indentation bars via text properties based on absolute column 
> position.  These bars are then offset in the displayed org src block by 2 
> columns from their correct locations, due to the extra space org has put 
> there.

Duplicate of
https://list.orgmode.org/orgmode/CAOn=hbevUMGS0-qMTy8kB4-db65s1Tmn0cQJcw8b++PZZ=vULA@mail.gmail.com/
Handled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]