You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assume we have sections in translation and reference buffer both in the following format.
some text 1
...
some text 2
- list item 1
- list item 2
- list item 3
By doing translate-recenter when cursor is at some text 2, you will get a highlighted overlay in translation buffer from some text 2 to - list item 3, while in reference buffer, it highlights - list item 3 only.
It is because the two functions markdown-forward-paragraph and markdown-backward-paragraph set to variables translate-*ward-paragraph-function are asymmetric. Doing markdown-forward-paragraph at some text 2 moves cursor to the next line after - list item 3, but markdown-backward-paragraph from this position moves cursor back to - list item 3.
translate-recenter invokes translate-sync-cursor-to-current-paragraph function to achieve cursor syncing. It counts paragraphs by using translate-forward-paragraph-function to jump over them one by one from the beginning of buffer to a maximum position no larger than the current (point), and then let the cursor in the reference buffer jump the same number of paragraphs. To have a pretty highlight overlay without extra blank lines, translate-backward-paragraph-function is used to do some adjustments, which causes these problem.
A possible workaround would be setting the translate-*ward-paragraph-function to forward-paragraph and backward-paragraph, since they are blank line based.
The text was updated successfully, but these errors were encountered:
Assume we have sections in translation and reference buffer both in the following format.
By doing
translate-recenter
when cursor is atsome text 2
, you will get a highlighted overlay in translation buffer fromsome text 2
to- list item 3
, while in reference buffer, it highlights- list item 3
only.It is because the two functions
markdown-forward-paragraph
andmarkdown-backward-paragraph
set to variablestranslate-*ward-paragraph-function
are asymmetric. Doingmarkdown-forward-paragraph
atsome text 2
moves cursor to the next line after- list item 3
, butmarkdown-backward-paragraph
from this position moves cursor back to- list item 3
.translate-recenter
invokestranslate-sync-cursor-to-current-paragraph
function to achieve cursor syncing. It counts paragraphs by usingtranslate-forward-paragraph-function
to jump over them one by one from the beginning of buffer to a maximum position no larger than the current(point)
, and then let the cursor in the reference buffer jump the same number of paragraphs. To have a pretty highlight overlay without extra blank lines,translate-backward-paragraph-function
is used to do some adjustments, which causes these problem.A possible workaround would be setting the
translate-*ward-paragraph-function
toforward-paragraph
andbackward-paragraph
, since they are blank line based.The text was updated successfully, but these errors were encountered: