Hacker News new | ask | show | jobs
by thomasikzelf 1622 days ago
> can you move into an if/while if it's not already selected?

Sorry I meant the condition of while, for and if.

> hmm, that's working for me, does anything at all happen when you drop it?

Now that I try it again it seems to be working. Before it would just drop the line bellow or above the "+ if".

1 comments

Ah OK. Tree mode navigation only works on whole lines as I think there's benefit to keeping the model simple and text cursors are good enough for horizontal navigation. I do have a couple of ideas for this though - 1) a key to select the condition so that you can edit it in normal mode (standard text editing), e.g. select the if then press c to change the condition; 2) some way of temporarily expanding single-line constructs into multi-line ones so that the vertical navigation commands navigate and edit them - so you would navigate to it then press a key that would temporarily expand the if (condition) to if (\n\tcondition\n). This would also work with things like argument lists - temporarily expand to get the arguments on separate lines for editing.