Sublime Forum

Selection Region Direction

#1

As you likely know if you’re reading this section on the forums, selection regions are directed, going from left to right or right to left. There’s also a primary end to the region: currently this is the ‘a’ member, and the betas are indicating which end of the region this is by drawing a caret there.

I’d like to change the primary end of the region from a to b: this means that a region like (3, 11) will have the right hand side highlighted, instead of the left hand side as it would be today. This is because by default, anyone writing a plugin will tend to generate regions where the first number is the smaller one, but it generally makes more sense for the right hand side to be highlighted. As far as I know, the only code that assigns a meaning to a vs b is shift+arrows, and the selection region rendering. I don’t think any plugins care about this.

Would changing the primary end from a to b break any plugins that I’m not aware of?

0 Likes

#2

This is now done in 20091004

0 Likes

#3

begin() and end() shouldn’t have changed, as they always return values such that begin() <= end(). Only direct uses of a and b should have changed.

0 Likes