Home Download Buy Blog Forum Support

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

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

Postby sassembla on Sat Apr 20, 2013 9:15 am

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?
sassembla
 
Posts: 12
Joined: Sat Apr 20, 2013 9:10 am

Re: view.sel() returns sublime.Selection, not RegionSet.

Postby sassembla on Fri May 10, 2013 9:43 am

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

http://www.sublimetext.com/docs/3/api_r ... .Selection

that was changed from ST2 to ST3. haha!
sassembla
 
Posts: 12
Joined: Sat Apr 20, 2013 9:10 am

Re: view.sel() returns sublime.Selection, not RegionSet.

Postby jps on Mon May 13, 2013 12:55 am

sublime.Selection.contains is not currently implemented correctly, and will always return None. I'll fix it for the next build.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: view.sel() returns sublime.Selection, not RegionSet.

Postby weslly on Mon May 20, 2013 2:36 am

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



Is there any alternative to get the current selections as a RegionSet?
weslly
 
Posts: 203
Joined: Sun Aug 28, 2011 3:57 am
Location: Brazil

Re: view.sel() returns sublime.Selection, not RegionSet.

Postby skuroda on Mon May 20, 2013 2:45 am

weslly wrote:
jps wrote:sublime.Selection.contains is not currently implemented correctly, and will always return None. I'll fix it for the next build.



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


I believe they are the same thing. It has just been renamed. Also, the contains method was fixed in build 3034.
skuroda
 
Posts: 689
Joined: Fri Oct 05, 2012 8:11 am

Re: view.sel() returns sublime.Selection, not RegionSet.

Postby sassembla on Sat Jul 13, 2013 1:44 pm

Oh, it works correctly! thank you jps!
sassembla
 
Posts: 12
Joined: Sat Apr 20, 2013 9:10 am


Return to Plugin Development

Who is online

Users browsing this forum: gotcha1 and 4 guests