I do believe there is a valid approach to a semi-synchronous scrolling between edit and a custom preview.
@oeyoews I did feel a compromise was posible through a Custom preview that displayed a line number when one was available in a “left hand column of the preview”.
This may be hard to express, but I think this may be possible with codemirror line numbers.
- Of course one line of code can result in many lines rendered, so many lines will not have a line number matching the code
- Often also a number of lines in the code result in a single rendered element eg a list widget code using 10 lines displays one list rendered. S we may only see the first line number in the code in the preview. Eg the line number where a widget is opened eg
<$list
- I think it would be ok if not all line numbers are represented in the preview, only those that can be identified. As we change the active line number, in the editor, it will jump to the relevant position when that position is available.
- However I expect blank lines and those contain comments will always be able to obtain a line number in the preview.
But you could see how the line number in the editor could be used to track where the editing is taking place and when it is possible to manifest a line number in the preview, make the preview scroll to that position, in jumps.
I believe the above can be made to work, and be of practical use, but it may need a new way to parse a tiddler, so I am unsure how complex it would be to implement.
- One way I Imagin it is what if every blank line was itself considered wiki text requiring a line number to be displayed.