billthefarmer / diary

Android personal diary - forked from http://git.savannah.gnu.org/cgit/diary.git
https://billthefarmer.github.io/diary
GNU General Public License v3.0
276 stars 58 forks source link

Cursor at the and of day note #85

Closed Kamul-PL closed 5 years ago

Kamul-PL commented 5 years ago

Another small suggestion: It would be more convenient if the cursor would be automatically placed at the bottom of a note. So If I want to add a note I would just type, without necessity to put it at the end manually.

billthefarmer commented 5 years ago

OK, that will be in the next version.

ghost commented 5 years ago

There are times when I like the cursor to go to the bottom and then there are times I like it to go to the top. Usually, though, to save from a lot of scrolling, I just wish it would stay where I left it.

billthefarmer commented 5 years ago

That's not so easy,

ghost commented 5 years ago

I'm not sure Diary remembering cursor position when switching entries is even desirable. That'd be a lot of remembering on the part of Diary.

With placing the cursor at the end of the entry, an option in the settings for the new behavior would allow someone to get the old, often useful, behavior.

I failed to mention last time the issue I'm noticing is losing scroll position when switching tasks or powering off the screen. This a separate issue though. Diary does remember the scroll position if the screen times out and I turn it back on.

billthefarmer commented 5 years ago

I had an idea about this. It's possible to put a line in a Markdown file that doesn't appear in the rendered view that is effectively a comment.

[//]: # (123456)

There's another one ^ here ^ you can't see. It would be possible for the app to put the current cursor position in the brackets when saving an entry and restoring it when loading the entry. Alternatively it could be used to specify a fixed position for that entry.

Edit: It turns out it's simpler than that, [<]: # for the start, [>]: # for the end, and [#]: # to save the position. The cursor position will be added [#]: # (42).

ghost commented 5 years ago

Nice. It doesn't seem to work though. Well, when I use [#]: #, it does add the number to it like [#]: # (42). It doesn't scroll there though.

billthefarmer commented 5 years ago

It's sporadic. Of course it worked perfectly when I was testing it. I have added code to force a scroll to the cursor position.

ghost commented 5 years ago

This almost works perfectly now. Diary (or Android) still doesn't scroll to the marked cursor position when switching task back to Diary but as soon as I hit the markdown button and edit button it scrolls right to the correct place in the entry.

yhutoo commented 4 years ago

Sorry for reopening. Could it be possible to keep the cursor in the same position in both views? It's sometimes arduous to recall the right position in long text. neutriNote for e.g. even shows the cursor position in both views. Best.

billthefarmer commented 4 years ago

It doesn't appear to be possible to find the scroll position of a WebView, or make it scroll to a position. When the user makes a change to the text and switches view the new text is loaded into the markdown view which puts it through the markdown parser and loads the HTML into the WebView. What happens after that is not determinable. When the user switches back the text view should be where it was.

yhutoo commented 4 years ago

I just found another handy workaround: before switching views, in both views, long press any character and when the pop up offers "copy etc" ignore it and instead press the switch botton. When switching again the same position is kept. So the user can edit, go back and forth, check the result, without interrupting the flow of her thinking.

I ignore if Write-Through / Write-Back Cache by the processor could also be a factor, see http://www.amidiag.com/

Document Library http://www.amidiag.com/support/library.cfm

Downloads http://www.amidiag.com/support/dl.cfm

Glossary of Terms

Hic sunt leones!

Thank You