edith
edith copied to clipboard
Remember caret position
On save, save the position where you were typing in the editor (for example in localStorage). This way, on page reload you can place the caret at the same place and continue typing where you were before.
What append if you edit the same "document" on another computer ?
# computer one
1: bla bla bla
2: ble ble ble *caret*
3: bli bli bli
# computer two - delete line 1 and 2
1: bli bli bli
What append when you come back to computer one with saved caret on line 2 ?
It'll depend on your storage: if localStorage, you should have an exception sending the caret at the end of the text, since you'll be out of bounds.
In your example I guess the ideal position should be to place it before bli bli bli
(so at the start of the document).
But whatever is the simplest would already be a great step! So here having it go to the end of the file like @ook says would be perfectly fine.