Home Download Buy Blog Forum Support

Refresh the buffer

Refresh the buffer

Postby notanumber on Tue Apr 12, 2011 4:28 pm

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.
notanumber
 
Posts: 5
Joined: Thu Mar 24, 2011 5:17 pm

Re: Refresh the buffer

Postby jps on Wed Apr 13, 2011 5:55 am

You can use the revert command for this, e.g., view.run_command('revert')
jps
Site Admin
 
Posts: 3069
Joined: Wed Mar 19, 2008 12:33 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests