sublime_zk
sublime_zk copied to clipboard
Using note template, place cursor on creation
Is there a way to place the cursor in the note after creating a note with the custom note template?
Here is my custom template. I'd like to now place the cursor after that final new line upon creation of the note. Is this possible?
"new_note_template": "---\nuid: {id}\ntitle: {title}\ntags: \norigin_id: {origin_id}\norigin_title: {origin_title}\n---\n#{title}\n"
I dug into this and although there are ways to place the cursor in ST3: creating a selection of length 0 from desired cursor pos to desired cursor pos, this doesn't work when creating new views (notes are opened in views). First, when creating a new view by opening the new note and placing the cursor, it doesn't work, gets ignored. The best I could achieve was to delay the cursor placement by 500ms so it would happen after the view had been opened. But even then the visual "caret" cursor would remain blinking at the beginning of the note. Only when you started typing you would notice that your typed input would show at the correct cursor position, which is super odd. I'll play around more when I get time but at the moment hopes are low until this gets addressed in ST3.
Thanks for trying! Sounds like it’s more trouble than it’s worth.
From: Rene Schallner [email protected] Reply-To: renerocksai/sublime_zk [email protected] Date: Sunday, January 28, 2018 at 10:20 AM To: renerocksai/sublime_zk [email protected] Cc: Alexander Chamessian [email protected], Author [email protected] Subject: Re: [renerocksai/sublime_zk] Using note template, place cursor on creation (#33)
I dug into this and although there are ways to place the cursor in ST3: creating a selection of length 0 from desired cursor pos to desired cursor pos, this doesn't work when creating new views (notes are opened in views). First, when creating a new view by opening the new note and placing the cursor, it doesn't work, gets ignored. The best I could achieve was to delay the cursor placement by 500ms so it would happen after the view had been opened. But even then the visual "caret" cursor would remain blinking at the beginning of the note. Only when you started typing you would notice that your typed input would show at the correct cursor position, which is super odd. I'll play around more when I get time but at the moment hopes are low until this gets addressed in ST3.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_renerocksai_sublime-5Fzk_issues_33-23issuecomment-2D361070591&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=j_eoU9TVYa9LTnnoTWWpgQ&m=tM1k88N1CE6DXsw8iReZ1jp69zDqyI_r3MLtBbSynys&s=KGxIIVQ5KJzzs2RD8mJa_gtNv82bhcJghC-YgGl-kZg&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AHGbcro4mmBEKZcfULMiX8uE0nZ7qR58ks5tPJA4gaJpZM4RlhgN&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=j_eoU9TVYa9LTnnoTWWpgQ&m=tM1k88N1CE6DXsw8iReZ1jp69zDqyI_r3MLtBbSynys&s=y-Bfro3vzst5eklxJxVEJ3_NFVSxLe1AHheCVQINrBI&e=.
@renerocksai Did Sublime Text 3 fix this?