vis: format go files on write
This commit is contained in:
@@ -316,3 +316,11 @@ end)
|
|||||||
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
||||||
vis:command('set relativenumber')
|
vis:command('set relativenumber')
|
||||||
end)
|
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