https://kotlinlang.org logo
#getting-started
Title
# getting-started
n

Nick

03/30/2023, 8:28 AM
How do I jump into the
TODO
without deleting the brackets and without using the mouse?
y

Youssef Shoaib [MOD]

03/30/2023, 8:30 AM
This isn't ideal but
Right
, `Left`*2, `Ctrl`+`Shift`+`Left` * 3, then start typing
s

Sam

03/30/2023, 8:32 AM
up, up, down, down, left, right, left, right, B, A, Start 🧌
❤️ 6
Is this a live template that comes from a plugin? I haven’t seen autocompletions put a
{ /* TODO */ }
block for a lambda like this before.
y

Youssef Shoaib [MOD]

03/30/2023, 8:34 AM
If it is a live template, I think you can edit it, so you might be able to change it so the selection is only around the comment
☝️ 1
v

Vampire

03/30/2023, 8:40 AM
Otherwise, just either type
{
or
Ctrl+Shift+w
with default key bindings
n

Nick

03/30/2023, 8:41 AM
typing
{
wraps it again in brackets
v

Vampire

03/30/2023, 8:43 AM
Oh, that's unexpected, sorry. With quotes it works that way. That leaves you with
Ctrl+Shift+w
n

Nick

03/30/2023, 8:44 AM
doesn't work on my mac 😞
v

Vampire

03/30/2023, 8:45 AM
... with default key bidings on non-macs You probabyl have to replace something with Cmd. Just look in your keybinding for "Shrink selection"
👍 1
n

Nick

03/30/2023, 8:46 AM
didn't work, 😞 oh well, gotta it all for now.
s

Sam

03/30/2023, 9:26 AM
Although I haven’t come across it before, I think the way I would intuitively handle it would be •
Escape
to drop the live template selection • ➡️ to position the cursor directly before the first
/
Option
+ ⬆️ (“grow selection”) to select the
/* TODO */
comment •
Delete
(Those are Mac keybindings — adjust as appropriate for your OS/keymap)
v

Vampire

03/30/2023, 9:55 AM
⌥ ↓ is the default shortcut to shrink selection on macOS keybinding, so that should usually work. If it doesn't, that would then really be strange and candidate for a bug report.
s

Sam

03/30/2023, 10:17 AM
I just tested this out, and grow/shrink selection doesn’t seem to work right with live templates. I’m not sure if I would class that as a bug or not. I made a live template that inserts
{ /* TODO */ }
as a default parameter value (which I assume is what’s happening in the OP) and when I use “shrink selection” it drops the whole selection, rather than shrinking step by step. Once it’s dropped the selection, “grow selection” does work okay, though.
Live template placeholders often do seem to behave differently from normal selections 🤔
😞 1
m

Mustafa Ozhan

03/30/2023, 12:06 PM
tab + enter(when hovered) if you have more than 1 todo tab should switch to next one when you click once more
v

Vampire

03/30/2023, 12:59 PM
How does that help? Does that preserve the curly braces? And more importantly, how do you hover and click wihtout using the mouse? o_O
😬 1
m

Mustafa Ozhan

03/30/2023, 10:39 PM
Ohh Sorry i think i have mixed with Xcode’s, well now just trying in Android Studio and the most close one I could find
DEL
+
{
the
}
is also automatically added after, so you find yourself between brackets Then you can go to below lambda with
Enter
👍 1
4 Views