Hi,

The issue is that when you press return, you insert a newline, with no
indentation, then call =org-indent-line= which edits the block in a
native buffer. This is supposed to remove any common indentation, but
there is now none. Then it reinserts the code in the org-buffer,
adding a new common indentation to the block.

If I recall correctly, in order to fix this, in =org-indent-line=,
before calling =TAB= in the native buffer, one should check the
current line indentation and if it is less than =block-content-ind=,
start by adding this much indentation to the current line.

This could be a bit fragile, and in particular it assumes that the
rest of the block has this =block-content-ind=, which might not be the
case. One could possibly at least check that the first line of the
block does have this much indentation. If it doesn't, just do
whatever.

--
Sébastien Miquel

Reply via email to