Home Download Buy Blog Forum Support

view.sel()l.contains(region) in ST3

view.sel()l.contains(region) in ST3

Postby sassembla on Thu Jun 27, 2013 9:46 am

In Sublime Text 3, this code returns None, wherever the selection set.

regi = sublime.Region(0, 10)
print("regi", regi, type(regi))

viewSel = view.sel()
print("viewSel", viewSel)

print("contains", viewSel.contains(regi))

I want to detect "the region is contains by selection or not".
How can I do it?
Posts: 12
Joined: Sat Apr 20, 2013 9:10 am

Re: view.sel()l.contains(region) in ST3

Postby adzenith on Thu Jun 27, 2013 3:11 pm

Cannot repro:

Code: Select all
>>> regi = sublime.Region(0, 10)

>>> viewSel = view.sel()

>>> print("contains", viewSel.contains(regi))

contains True
Posts: 1403
Joined: Mon Oct 19, 2009 9:12 pm

Re: view.sel()l.contains(region) in ST3

Postby jps on Fri Jun 28, 2013 5:21 am

This is an issue in 3033, but has been fixed in the dev builds as of 3034
Site Admin
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 5 guests