Home Download Buy Blog Forum Support

Refreshing the Buffer

Refreshing the Buffer

Postby mikestead on Sat Jul 30, 2011 7:29 am

On post-save I'm checking to see if the file which was saved is empty and if it is calling an external tool to auto-fill this file with some default content.

My issue is that the active buffer is not refreshing with this new content. I do see a "Reloading <file path>" printed to the console, but the buffer does not visually refresh.

If I set focus to another view and then put focus back on the original view the new content is displayed.

I've seen a similar question raised here viewtopic.php?f=6&t=2001 but the "revert" command didn't seem to do anything.

Any ideas how to get around this? Perhaps it may be good to have a "reload" or "refresh" option in the view API?
mikestead
 
Posts: 1
Joined: Sat Jul 30, 2011 7:17 am

Re: Refreshing the Buffer

Postby max.hauser on Wed Oct 19, 2011 2:21 pm

Hi,

i had the same problem and just found out that you can refresh the current view with this snippet:

sublime.active_window().focus_view(sublime.active_window().active_view())

HTH,

max
max.hauser
 
Posts: 2
Joined: Wed Oct 19, 2011 2:19 pm


Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests

cron