edith icon indicating copy to clipboard operation
edith copied to clipboard

Remember caret position

Open sunny opened this issue 8 years ago • 3 comments

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.

sunny avatar Jan 18 '17 10:01 sunny

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 ?

optyler avatar Apr 07 '21 11:04 optyler

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.

ook avatar Apr 07 '21 12:04 ook

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.

sunny avatar Apr 07 '21 17:04 sunny