[TxMt] Rev961 scope change

Allan Odgaard throw-away-1 at macromates.com
Wed Apr 12 22:56:37 UTC 2006


On 12/4/2006, at 21:17, Oliver Taylor wrote:

> [...] Why has this change been enacted
> (yes, I realize it's "nightly-build" only at this point. Is this a
> good thing? Does this force our scope selectors to be more precise?

Yes, it will require people (who rely on specific scoping of caret)  
to update language grammars -- I certainly do not like to introduce  
such (compatibility breaking) changes, but I do feel this one was for  
the better (although with r961 it was also meant to “test the waters.”)

The one deciding argument for changing the caret to have the scope of  
the character to the right instead of the left was, that otherwise it  
would not be possible to assign a scope to the caret, when it was at  
the beginning of the line (other than maybe let it get the scope of  
the newline, but that rarely makes sense.)

There are cases where it is nice to override functionality for “the  
entire line”, for example reflow paragraph for quoted text in letters  
(ctrl Q).

If the caret did not get the scope of the first character of that  
line, it would mean that to trigger such context sensitive actions,  
one would have to first move the caret to column 2. This of course,  
would mostly be rather inconvenient.

Since we can match the newline character, this change still allows us  
to decide the scope  of the caret when it is at the end of a line, by  
assigning the scope to the newline. So the change didn’t just shift  
the problem (as has otherwise been the case for all previous examples  
of when it makes sense to use the left or right character), and that  
is really what convinced me that the side should be changed.







More information about the textmate mailing list