josue-rojas/md-editor

Improve render

Opened this issue · 0 comments

My idea for improving render is
Change textarea values to arrays of string. Keep track of positions of beginning of arrays in reference to their position of the string. So each el in the array should be a new line. In another array we keep track of the number character position that each el starts at.
In this way we assume when we edit a line the only lines that changes is that one and the ones following it. Worst case is we edit the first line so we have to re render everything. But compare to what we have currently were it always re-render, when we edit a line in the middle we only have to re-render this and the ones after.

Another idea I am debating on is using an array of objects. In this way we can store more information about the line. (inspired by looking at google docs api).