Open gerroon opened 8 months ago
Yes, so far I've kept it simple and avoided implementing any kind of diffing logic to try to find where the cursor should go to make it feel like it stays in the same position after the buffer file has changed on disk.
It should never change the current location or the view of the page regardless of any change.
Do you mean that the cursor should stay at the exact same place, character count-wise? E.g. if the cursor is at position 4000 in the buffer, it should still be at position 4000 after the update? What if the new changes have inserted additional data at the top? What if the file has completely changed?
The cursor is at 0 before the modification, after the modification reload the cursor goes to 4000 (the bottom of the page). Should not it stay at 0? Bear in mind it does not matter where the change has been it always goes to the bottom of the page after the modif, even if you just add a word at the top.
I do not think we need a diff implementation, we just need to make sure the cursor does not change to random places, even if it was modified in another app.
Well, for the case where the cursor is either at the beginning or at the end of the buffer, that would work. For other cases, you would have to implement some kind of logic to determine where the cursor should go.
My point is that the cursor should never move (stays at where it is) after an update rather than trying to figure out where it should go.
Do you mean that the cursor should stay at the exact same place, character count-wise? E.g. if the cursor is at position 4000 in the buffer, it should still be at position 4000 after the update? What if the new changes have inserted additional data at the top? What if the file has completely changed?
I think it should stay simple and there be a preference for it to be at the bottom or top line.
The way I use my scratchpad is that the most important stuff stays at the top, the least important is at the bottom. It's annoying that the cursor keeps moving to the very bottom to the irrelevant stuff rather than staying at the top.
I agree with @Victor239, at the moment cursor always jumpts to bottom, even when the app is started. I profer the cursor to be at the top at least.
Describe the bug Modifying the buffer in another app makes Heynote to change the cursor's position all the way to the bottom
To Reproduce Steps to reproduce the behavior: move the cursor all the way up in the page, add some text and let it stay there open and modify the buffer.txt by adding anew line at the top watch for heynote's reloading of the changes
Expected behavior It should never change the current location or the view of the page regardless of any change. However in this case the change is done at the top so it should at least goto where they change is Desktop (please complete the following information):