I wrote a Sublime plugin to beautify Go code by calling the standard toolchain’s “go fmt” tool via a Sublime build system.
After that tool has done its thing, I use Sublime’s ‘revert’ command to reload the active view from disk in its beautified form.
That reloading picks up the changes, but only if a time.sleep(…) is inserted between running the build system and calling ‘revert’. Why is that? Isn’t everything supposed to be synchronous?
Here is the plugin:
github.com/frou/GoFeather/blob/ … nds.py#L15
Here is the build system it calls:
github.com/frou/GoFeather/blob/ … lime-build