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

[Feature Request] save cursor position #520

Open
tessus opened this Issue May 14, 2018 · 11 comments

Comments

Projects
None yet
7 participants
@tessus
Copy link
Collaborator

tessus commented May 14, 2018

/ref https://discourse.joplin.cozic.net/t/save-cursor-position-within-the-note

Summary:

Every time one switches between notes, the cursor position is reset to the top of the note.
When working with a few notes simultaneously, this behavior can be rather tedious.

@nr458h

This comment has been minimized.

Copy link

nr458h commented Jul 5, 2018

I would like to add that in my opinion it is not necessary to sync the courser position between devices because where I want to work on a note depends on the device so it would be something stored locally.

@tessus

This comment has been minimized.

Copy link
Collaborator Author

tessus commented Jul 7, 2018

@nr458h you also got a point. I believe there are use cases for both (save locally, sync). The nicest would be an option to choose, but I think @laurent22 doesn't consider a sync option due to performance reasons anyway.

@tessus

This comment has been minimized.

Copy link
Collaborator Author

tessus commented Sep 4, 2018

@laurent22 I am not sure, if this belongs in this ticket, but what about the status of the current note? Whenever I switch to a different notebook, the first note is selected. In my opinion, it should always select the last note that was used.

Maybe we should rename this issue to save status of note which would include the last edited note within a folder/notebook and the cursor position within the note.

What do you think?

@sciurius

This comment has been minimized.

Copy link

sciurius commented Nov 13, 2018

I think it makes sense to store the cursor position in the metadata to keep track of the last place modifications were made. The overhead would be neglectible, since the note is going to be synched anyway.
I think it does not make sense if just browsing/scrolling through a note would lead to its physical modification.

@subi54

This comment has been minimized.

Copy link

subi54 commented Nov 13, 2018

Knowing where you were editing and picking it up from there on another device would be sweet.

On Joplin desktop (Windows), if you press ctrl & click, you can edit multiple lines or items at once. Thank you @laurent22 for that btw.
The question is, are all the cursor positions saved? That'd be waste.

Also, if someone has a lot of notes, won't all that metadata be heavy? I mean I love the sync speed of Joplin, wouldn't want to trade it for this.

@hfccgit

This comment has been minimized.

Copy link

hfccgit commented Feb 14, 2019

In my opinion, remembering the cursor position is not always a good idea.

In my case, I have different sections in the same note so I write in different places randomly according to my needs. If it starts from the top/bottom, it is easier for us to find the section we are looking by scrolling (if we are in the middle, we might not know if we have to go up or down).

For that reason, I would suggest to add it as a preference in general options (remember position/start top, start bottom).

@laurent22

This comment has been minimized.

Copy link
Owner

laurent22 commented Feb 14, 2019

@hfccgit, I guess you mean for the mobile app? Because on desktop you can tell where you are based on the scrollbar. On mobile, maybe the problem is that the scrollbar is not visible and there should be some indicator (like "Pos: 58%") to show this.

@tessus

This comment has been minimized.

Copy link
Collaborator Author

tessus commented Feb 14, 2019

@hfccgit

In my opinion, remembering the cursor position is not always a good idea.

In that case you are rather the odd person out. Every text editor and frontend usually remembers the last cursor position.

I would suggest to add it as a preference in general options (remember position/start top, start bottom)

This is certainly a great idea. However, if there's only one choice, I'd rather be able to start editing where I left off.

@tessus

This comment has been minimized.

Copy link
Collaborator Author

tessus commented Feb 14, 2019

@hfccgit e.g. one could also follow it to the other extreme. I'd love to be able to sync the cursor position and last accessed notes across devices, but I am afraid a lot of people do not want this behavior.

@hfccgit

This comment has been minimized.

Copy link

hfccgit commented Feb 14, 2019

@laurent22 Yes, I'm referring to the mobile app (Android). For the desktop it's fine in my opinion as the scrollbar starts at the top and I can set the cursor with the mouse (in the last Windows version).

@tessus Ok.

@tessus

This comment has been minimized.

Copy link
Collaborator Author

tessus commented Feb 18, 2019

@laurent22 Thank you for implementing this. Saving and restoring the scroll position is a great start, but it has a few problems:

  • The position is wrong, if one

    • resizes the window
    • changes the layout

    before restoring of the position takes place.

  • Using tab to jump to the editor positions the cursor in the first row and first column.

While the first item is only an annoyance, the second item has rather dire consequences. Let's say you are in the middle of a long note and switch to a different note. After switching back, the position is shown correctly. You use tab to go to the editor. However, you can't see the cursor and as soon as you start typing the position scrolls to the top of the note. (Which also means you lost the cursor position.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.