According to the API reference, View.find_by_class()
returns a region. However this plugin code:
import sublime
import sublime_plugin
class TestPlugin(sublime_plugin.TextCommand):
def run(self, edit):
next_region = self.view.find_by_class(
0,
True,
sublime.CLASS_LINE_START
)
print(type(next_region))
…prints this:
>>> view.run_command("test_plugin")
<class 'int'>
What’s happening?