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 · 21 comments
Open

[Feature Request] save cursor position #520

tessus opened this issue May 14, 2018 · 21 comments
Labels
backlog We'll get to it... eventually... enhancement Feature requests and code enhancements

Comments

@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.

@laurent22 laurent22 added the enhancement Feature requests and code enhancements label May 14, 2018
@ghost
Copy link

ghost 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
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
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
Copy link

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.

@Outi-s
Copy link

Outi-s 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
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
Copy link
Owner

@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
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
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
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
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.)

@stale
Copy link

stale bot commented Sep 22, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the stale An issue that hasn't been active for a while... label Sep 22, 2019
@tessus
Copy link
Collaborator Author

tessus commented Sep 28, 2019

I still think this should be kept open. The current way to save the current cursor position might have other side effects (as the scrolling issue in #1546).

@stale stale bot removed the stale An issue that hasn't been active for a while... label Sep 28, 2019
@reinerwein
Copy link

Hi, I want to request this feature for the iOS version. Or at least give an option to set the cursor to the top of a note when open it. Currently, the cursor is always set to the bottom of the note. Some might like it, some not.

@tessus tessus added the backlog We'll get to it... eventually... label Jan 29, 2020
@maichai
Copy link

maichai commented Apr 2, 2020

Motivation:

  • When switching between notes in Joplin the last cursor position is lost and the user has to scroll back tediously to the last cursor position.
  • When switching between Apps on the mobile phone the Joplin App might be swapped out / ended by the OS, losing the last cursor position. When coming back to Joplin to continue editing the note the user has to scroll back rediously to the last cursor position.

Proposal:

I think a preference option would be very useful to let the user switch between the following options when switching to edit mode:

-set cursor to the top
-set cursor to the bottom
-set cursor to the top line shown in viewing mode when edit button was pressed
-set cursor to the last position when the note was in editing mode

For this to work, in the metadata the note should preserve its last editing cursor position.

With these choices most requirements should be met.

@dbogdanov
Copy link

This combined with a possibility to quickly switch between recent notes will improve any multi-note workflow a lot.

@PaperTsar
Copy link

+1 This feature would be great. Save the cursor/scroll position when switching between notes. It doesn't necessarily have to sync, single device scroll position saving would still be really great. It's a real pain when editing multiple notes that I have to scroll back down again from the top each time I switch notes.

@dfwdraco76
Copy link

I'm the one that opened the issue with joplin-note-tabs above. I didn't realize it was an issue with the core app -- so I'd love to see this implemented as well.

@GwynethLlewelyn
Copy link

GwynethLlewelyn commented Jan 17, 2021

Ok, so I was wondering about my sanity, forgetting to click on an option somewhere and getting as 'default' behaviour 'always jump to top', because, well, all editors I use will jump to the last position instead. Oh... with the exception perhaps of WordPress... which uses... TinyMCE!

Hmmm. I'm starting to see a pattern here... 🤔🧐

Actually, to be more precise, in Joplin, the page doesn't simply 'jump to the top'. It visually does so, but the cursor is not even inside the text area (this is true on the visual editor and on the Markdown editor). In other words, to get to the end of a note, you have to click on the note and then scroll to the bottom. Two steps!... for something that 'comes out of the box' on pretty much everything out there used for editing.

I guess that the developers have been mostly using less-than-a-page notes, where this 'automatically moving to the last position' is not really an issue.

Personally, I use the visual editor most — but occasionally switch to Markdown (this is especially true when wanting to add some Markdown that isn't on a comfortably-placed button on the visual editor's toolbar). Nothing can be more annoying than editing something somewhere on the middle of a 20-page document, switching to a different editor... and being placed at the top... patiently scrolling down until I find where I had been... do the changes... switching back to the visual editor and gaaaah the cursor is now at the top again!

I'm a great fan of the Principle of Least Surprise. While naturally enough each application has its quirks and no two applications will ever work in exactly the same way (much less if running under different operating systems), over the decades of GUI development, we have slowly moved towards some expected behaviour across applications. For example, most people expect that when you scroll down a text (via a slider, a gesture, whatever), the page does not scroll up instead, just because the developer thinks that it makes more sense that way. Instead, such a reversal of an 'obvious' UI/UX experience is relegated to an option instead. In most OSes, for instance, you can configure your mouse/trackpad/gesture so that it works in the opposite way than the 'standard': a typical example is, say, flight simulators, where pressing 'down' actually moves the plane/spaceship 'up' (mostly because that's how it works with joysticks on 'real' plane cockpits). But most games (I'm thinking of one from the late 1980s...) will have an option to reverse the keys, for those who couldn't care less about how 'real' planes actually work, and just prefers to stick to the Principle of Least Surprise.

In conclusion: I understand that for some people, having notes starting always at the top makes more sense to them. A good use case is keeping track of a changelog, where traditionally newer things come before old ones; another scenario is sticking to very short notes where the issue of scrolling up/down is not really very important. I'm fine with those exceptions, but they ought to be treated as such: exceptions. Most people will want their documents to be opened in a predictable position, and this is usually the last position they were at. I'd be fine with an 'always on the bottom' choice as an alternative to 'remembering' the last position (and even syncing it across devices!). I'd still grumble about 'losing' the position when inevitably I'd switch from one note to another, to quickly check something up, return to the original note... only to find that the cursor is not where I expected it to be. Ouch!

I'm relatively new to Joplin (trying to get rid of Agenda, Notes and Stickies on my Mac...) and I'm aware of a few workarounds. One would be to drop an anchor and then just jump to it. I would only need to remember to drop anchors all the time (and delete the old ones). Possibly a plugin could do that automatically for me. Because the anchor is part of the document, it would be easily synced across devices; and with some clever CSS styling, it might even be possible to avoid having those anchors visible or even printable (or exportable). However, I also think that it's better to have the cursor position as metadata, and even if it's not synced between devices, it's better than nothing... which is what we have now.

I'm actually quite surprised that so few people in the past 2-3 years have complained about the lack of this feature! 😯

@danielepusceddu
Copy link

I'm actually quite surprised that so few people in the past 2-3 years have complained about the lack of this feature!

I agree. I'd really like to have this. I came here from google, looking for a solution

@4127157
Copy link

4127157 commented Mar 25, 2023

I came here from Google as well. I still cannot find a solution to the problem. Please consider implementing, best case as an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We'll get to it... eventually... enhancement Feature requests and code enhancements
Projects
None yet
Development

No branches or pull requests