i tried adding the following to my plugin:
- Code: Select all
f = view.fileName();
wnd = view.window()
wnd.reloadFile(f, 0, 0)
OR
- Code: Select all
view.runCommand('revert')
but none seems to work, any suggestions?
f = view.fileName();
wnd = view.window()
wnd.reloadFile(f, 0, 0)
view.runCommand('revert')f = view.fileName();
s = open(file, 'r').read()
region = sublime.Region(0L, view.size())
view.replace(region, s)
import sublime, sublimeplugin
import functools
class ThingyCommand(sublimeplugin.TextCommand):
def run(self, view, args):
# ...code to write out file here
sublime.setTimeout(functools.partial(view.runCommand, 'revert'), 0)
Return to Plugin Announcements
Users browsing this forum: No registered users and 8 guests