Sublime Forum

Refresh the buffer

#1

Is there a way to refresh the buffer of the active view?

I’ve written a git command to checkout the active file, effectively undoing everything since the last commit but when you run it, the buffer doesn’t update to reflect that the file on disk no linger represents what you’re looking at. Instead, it appends the ‘*’ to the file name in the tab making it look like the file has unsaved changes.

I’d like to have the active view discard the changes and reload what’s on disk as part of the command but can’t see how this would be done given the exposed API.

1 Like

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

You can use the revert command for this, e.g., view.run_command(‘revert’)

0 Likes