vis: format go files on write
This commit is contained in:
@@ -349,3 +349,11 @@ end)
|
||||
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
||||
vis:command('set relativenumber')
|
||||
end)
|
||||
|
||||
vis.events.subscribe(vis.events.FILE_SAVE_PRE, function(file, path)
|
||||
if path:find('[.]go$') then
|
||||
-- formatting is async, so when reformated you should write file again
|
||||
vis:command('lspc-format')
|
||||
end
|
||||
return true
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user