Sublime Forum

Refreshing the Buffer

#1

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 " 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 Refresh the buffer 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?

0 Likes

ST2 & ST3: View is not updated after adding new Region
#2

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

0 Likes