Okay from looking at your new test case:
1. clicking in Preview to sync CodeView works just fine as DNSB reported.
2. But clicking in CodeView to sync Preview, the command to scroll Preview will not be able to reach text immediately past an inline xhtml comment as the xhtml comment just does not exist in the Preview DOM tree.
I was able to "fix" this by ignoring inline xhtml comments when figuring out where to scroll Preview to. With this change, clicking in CodeView on the first "always" and clicking in CodeView on the second "always" will tell Preview to scroll to the parent p tag and not a missing inline xhtml comment. That way Preview will not skip to the "top" which is what it is supposed to do when the sync location fails.
I have pushed this change to master. It will appear in the upcoming release Sigil-2.0.0.
|