Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remember caret position #25

Open
sunny opened this issue Jan 18, 2017 · 3 comments
Open

Remember caret position #25

sunny opened this issue Jan 18, 2017 · 3 comments

Comments

@sunny
Copy link
Owner

sunny commented Jan 18, 2017

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.

@optyler
Copy link

optyler commented Apr 7, 2021

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 ?

@ook
Copy link
Collaborator

ook commented Apr 7, 2021

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.

@sunny
Copy link
Owner Author

sunny commented Apr 7, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants