Sublime Forum

[plugin]: open flie then jump to

#1

Hi, I 'm trying to open new file, then jump to (select) a specific text.
This simple code doesn’t work:[code]import sublime, sublime_plugin

class tidea_link(sublime_plugin.TextCommand):
def run(self, view):
new_view = window.open_file(‘C:\test.txt’)
sels = new_view.sel()
new_sels = ]
for sel in sels:
new_sels.append(new_view.find(‘sometext’, sel.end()))
sels.clear()
for sel in new_sels:
sels.add(sel)[/code]
Please help!

0 Likes