Script to focus on caret on key press #4769
Unanswered
ferrlen
asked this question in
Show and tell
Replies: 1 comment
-
Little buggy but works. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all,
I've been running an old version of Trilium and wrote a script to focus on the caret when the window was showing a different part of the text, since Trilium didn't do that in the past. I updated Trilium to the latest version, but I noticed that for Ctrl Z and Ctrl Y (undo and redo) the window doesn't scroll back to the caret. Thus, one might accidentally undo or redo something and never notice it.
The following script makes Trilium focus on the caret when one wants. Additionally, I wrote it so that by pressing Shift by itself will scroll back to the caret.
Update: I slightly improved the first conditional for triggering the function
Beta Was this translation helpful? Give feedback.
All reactions