@WTFE said in Code Teachers?:
@Thenomain said in Code Teachers?:
TextWrangler allows me to select the contents and parens/etc. just like the others, but it also puts in two insertion points: One at each end of the selection so if I use the keyboard to shift-arrow backwards, it expands the selection backwards. All the other programming text editors I've tried put only one insertion point at the end.
I'm having a hard time picturing what you're saying here. What do you mean by "two insertion points"? What happens if you type when text is selected? Do you start typing on both sides of it?
It's a selection, so like most selections it deletes what's selected and you start typing like usual.
Perhaps the technical term is "two selection points"?
Imagine the editor can both bracket-match and select the contents and brackets of the following text: cat( meow, meow, meow )
I would have selected: ( meow, meow, meow )
Now I type "shift + left arrow" three times.
In most text editors, I would end up with the following selected: ( meow, meow, meo
In TextWrangler, I would have: cat( meow, meow, meow )
This is because TextWrangler's behavior is that if you're selecting from a selection, you're not trying to shorten it, but expand it. It does this by having two insertion (selection, whatever) points, one at each end. Depending on the direction you're expanding the selection, it will change the location of the more appropriate point.
This latter behavior is how I code on keyboard, only I select by word, not by character. It was mentioned this way to make a more dramatic and therefore clearer example. On these other editors, typing "cmd + shift + left arrow" once would get me: ( meow, meow,
Horrible. I can't do anything with that selection.
('cmd + left/right arrow' moves one word at a time, '+ shift' engages selection. Not too different from a lot of editors, but not everyone is Mac-friendly so I wanted to add even more description. Possibly too much.)
Why would I ever want to do this?
Because there are times, many many many times, where I have something like:
treat( %0, cat( meow, meow, meow ))
And I want to replace all instances of 'cat( <stuff> )' with 'dog( <different stuff> )'.
The variables I'm calling with may change, so I want to simply select it all at once, cull it, and start typing, in this case: dog( bark, woof, tail-wag ).
Well if I can't select 'cat( ... )' and its entire contents, then this is a tedious, annoying chore. As if dealing with Mushcode isn't tedious enough, I'm going to use the editor and style that makes things go as fast as possible.