Hacker News new | ask | show | jobs
by gushogg-blake 1630 days ago
Thanks for the feedback!

- can you move into an if/while if it's not already selected? For already selected blocks I've had it both ways and found it better to be able to drag from anywhere in the block - you can select a child by clicking it. Both ways have their advantages and disadvantages though. "d" should also work to navigate to a block's first child.

- yes maybe some kind of visual indicator would be good, but if required after the first few uses then the interaction would need to be redesigned I think, as there shouldn't be any unexpected or unintuitive behaviour

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

- yeah, haven't implemented that yet

I thought about doing it as a plugin as well, but I think trying to add something genuinely new to an existing editor would be possibly harder than just making one (I've been working on Treefrog for about 7 months full time and using it as my only editor for the last 2), and would end up either not fitting in well with the existing UI or having clunky UX to switch between modes etc. Designing new modes from the ground up (and being able to prototype them quickly with web tech and Electron) allows for much easier experimentation.

1 comments

> 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".

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.