Sublime Forum

View.sel() returns sublime.Selection, not RegionSet

#1

on ST3 Build 3021,
view.sel() returns sublime.Selection, not RegionSet.

because of that, view.sel().contains(SOME_REGION) returns None every time.
Is this bug?

0 Likes

#2

I found the reason why view.sel() returns sublime.Selection in api.

sublimetext.com/docs/3/api_r … .Selection

that was changed from ST2 to ST3. haha!

0 Likes

#3

sublime.Selection.contains is not currently implemented correctly, and will always return None. I’ll fix it for the next build.

0 Likes

#4

Is there any alternative to get the current selections as a RegionSet?

0 Likes

#5

[quote=“weslly”]

Is there any alternative to get the current selections as a RegionSet?[/quote]

I believe they are the same thing. It has just been renamed. Also, the contains method was fixed in build 3034.

0 Likes

#6

Oh, it works correctly! thank you jps!

0 Likes