Closed nburyak closed 5 months ago
Can not reproduce it.
Try to change storage path to path without emoji.
Unfortunately, neither changing the location to default (which was actually set), nor removing the emojis in the path didn‘t help. Let me debug, maybe I‘ll find the rootcause
Also cannot reproduce. Please share a reproducible set of notes/folders.
You can also create a new user account on the same Mac to check if it happens there. If not, the problem is an app running in your user account.
I've debugged the code and figured out the following: while typing the text the Note gets reloaded and the cursor changes its position to 0 or previously saved position depending on the restoreCursorPosition
value. I assume, this happens every time when the Note is saved to the file.
Here's the stack trace and the exact place of code, which causes cursor jumping during typing:
Another observation is restoring the position, which is different from the saved one. And this happens exactly during typing text (as I described above):
func saveCursorPosition() {
...
NSLog(">>> saveCursorPosition: \(length)")
...
}
func restoreCursorPosition() {
...
NSLog(">>> restoreCursorPosition: \(position)")
...
}
2024-01-24 19:38:26.438408+0100 FSNotes[19008:5384306] >>> saveCursorPosition: 16
2024-01-24 19:38:26.712355+0100 FSNotes[19008:5384306] >>> saveCursorPosition: 17
2024-01-24 19:38:27.030987+0100 FSNotes[19008:5384306] >>> restoreCursorPosition: 8
I have a suspicion, the issue is related to the iCloud backup. Once I moved the Notes Storage outside of the iCloud folder, the issue was gone. Obviously, it doesn't help much because I want to sync my notes with the mobile phone. But this narrows down the problem
What about this option in the Settings? Did you try to enable it?
What about this option in the Settings? Did you try to enable it?
https://github.com/glushchenko/fsnotes/assets/2462403/f53d590e-05b0-4270-a3fd-63cb14144e94
With the Restore cursor position
setting ON the cursor jumps a few symbols to the right, which is even worse, than jumping to the beginning of the Note.
I've posted the logs above: the cursor position in the func restoreCursorPosition()
isn't same, as the last saved value in func saveCursorPosition()
. It's definitely related to the iCloud sync but I can't find out how to fix this.
@nburyak please check this experimental build:
Hi @glushchenko, thanks for the fix. I've just tested it - works much better now and doesn't mess with the text anymore 👍
Although, you may still notice a small glitch: in the word fixed
I type the x
character, then it disappears and re-appears again. I'd consider it a minor issue.
https://github.com/glushchenko/fsnotes/assets/2462403/45bbebe9-8436-4b4d-857f-5713ffcb4a92
OK, another try. Please test it and let me know.
@glushchenko Thanks for the build - I can confirm, that in the latest version the issue is completely gone ✅
Is this fix planned for any of the upcoming AppStore releases?
Is this fix planned for any of the upcoming AppStore releases?
Yes
Description
The cursor jumps to the beginning of the Note every time, when the title of the Note gets updated
To Reproduce
https://github.com/glushchenko/fsnotes/assets/2462403/d121acfa-2f93-4060-8774-fad46d6c00d3
Expected behavior
The cursor should never be automatically moved during typing
FSNotes version
Version 6.6.6 (610) - (AppStore version)
macOS/iOS version
macOS 14.2.1 (23C71)
Additional context
No response