Sublime Forum

Substring of region from a point until the end of the view

#1

I can get a region as a string using

view.substr(sublime.Region(x, y))

If x = 0 I will get everything from the beginning of the view up until y. Is there a similar way to set y to get everything up to the end? Having y = -1 as in a string slice is the sort of thing I’m after, but that doesn’t work here.

(Really what I want is the whole view as a string, so if there’s a different way to get that result I’d be happy with that!)

0 Likes

#2
view.substr(sublime.Region(x, view.size()))
0 Likes

#3

Thanks. (I should have found that in the documentation, but I didn’t.)

0 Likes