Sublime Forum

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

#1

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?

0 Likes

#2

Cannot repro:

[code]>>> regi = sublime.Region(0, 10)

viewSel = view.sel()

print(“contains”, viewSel.contains(regi))

contains True[/code]

0 Likes

#3

This is an issue in 3033, but has been fixed in the dev builds as of 3034

0 Likes