Open Esokrates opened 4 years ago
I think the line in the preview corresponding to the cursor position should be handled like this:
Case 1: There is enough text before and after the current cursor position to display the corresponding line in the middle: just display the corresponding line in the middle of the preview.
Case 2: There is no text after the current cursor position: Handle it like now, but make sure there is no "blind spot" like demonstrated above.
Case 3: There is not enough text above the current cursor position to display the corresponding line in the middle: Just show the corresponding line on top. (For the beginning of the document this actually working well right now).
Sometimes when writing there is a blind spot, the preview does not jump to the end of the file until a certain amount of characters is typed in, this is demonstrated in the following video: https://youtu.be/u3D8MYF_Ivs
The file to reproduce can be found here: https://gist.github.com/Esokrates/4f73d84142da746b97e1478d012de86b/