It's funny how just a one line comment about a new version of the app can break almost every scope you've got....
[CHANGED] The scope of the caret is now that of the character to the right of the caret, rather than that on the left side.
Just a heads up to all you bundle developers, check your scopes to make sure this doesn't effect you. Particularly if you have macros or snippets that only take effect at the end of a line.
^[a-z\s.]{,15}$ ...will no longer work. Removing the "$" will fix it (in this case).
I haven't seen anyone talking about this, but it strikes me that it could adversely effect many people. 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?
Am I wrong?
On Apr 12, 2006, at 3:17 PM, Oliver Taylor wrote:
It's funny how just a one line comment about a new version of the app can break almost every scope you've got....
[CHANGED] The scope of the caret is now that of the character to the right of the caret, rather than that on the left side.
Just a heads up to all you bundle developers, check your scopes to make sure this doesn't effect you. Particularly if you have macros or snippets that only take effect at the end of a line.
^[a-z\s.]{,15}$ ...will no longer work. Removing the "$" will fix it (in this case).
I haven't seen anyone talking about this, but it strikes me that it could adversely effect many people. 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?
Am I wrong?
Yeah. Me and Allan were talking about it a bit on IRC. Check out the wiki page about it http://macromates.com/wiki/ToDo/ ScopeOfSelection
Feel free to edit that page if you can think of more examples of how the scope should work.
I have strong feelings about it but i won't have any free time to think about it for a while.
thomas Aylott—subtleGradient—oblivious@subtleGradient.com
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.