George Moutsopoulos <[email protected]> writes: > Sorry for the delay. I attached a better fix but it still has an issue. > > The patch replaces `end' (that is a point in the tangled file) with > the end point of the block in the org file, like you suggested. It is > an improvement. The condition is the same: do not move past the end. > The issue is that the offset is still from the tangled file, which has > unescaped code.
Thanks! Yes, this one is indeed not ideal, but acceptable I think. > A complete fix would need to calculate the offset using escaped > characters. org-edit-special and org-edit-src-exit preserve the point > in the special buffer, so one could use these to find the true > target-char (a variable defined in the function), but these functions > are too heavy (load modes). Or one could make a > org-src-forward-unescaped-char. What do you think? We can either stop here, and I apply the patch, or we can try to do better. What you suggested is indeed heavy. Instead, one possibility is using line number instead of character offsets. Maybe even column number (but then we need to count from the end of line). -- Ihor Radchenko // yantar92, Org mode maintainer, 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>
