In the solution to #82, the preview window is only scrolled if the cursor line matches the start line of a block. If the cursor is not positioned at the start line of a block, the sync logic should find the block nearest to the cursor line and scroll to that block.
Atom : 1.12.5
Electron: 1.3.9
Chrome : 52.0.2743.82
Node : 6.5.0
asciidoc-preview version: 2.7.2
Proposed solution
There are at least two ways to solve this problem. First, we could account for every line when building the block position index. That way, no change is needed to the scrollPreview method (and resolution during the event is immediate). The other solution is to attempt to do this calculation in the scrollPreview method.
Description
In the solution to #82, the preview window is only scrolled if the cursor line matches the start line of a block. If the cursor is not positioned at the start line of a block, the sync logic should find the block nearest to the cursor line and scroll to that block.
asciidoc-preview
version: 2.7.2Proposed solution
There are at least two ways to solve this problem. First, we could account for every line when building the block position index. That way, no change is needed to the scrollPreview method (and resolution during the event is immediate). The other solution is to attempt to do this calculation in the scrollPreview method.