diff --git a/Build Systems/Zig.sublime-build b/Build Systems/Zig.sublime-build index f55c6d3..f944a95 100644 --- a/Build Systems/Zig.sublime-build +++ b/Build Systems/Zig.sublime-build @@ -19,7 +19,8 @@ { "cmd": ["zig", "fmt", "$file"], "selector": "source.zig", - "name": "Format File" + "name": "Format File", + "quiet": true, }, { "cmd": ["zig", "build", "test"], @@ -36,7 +37,8 @@ { "cmd": ["zig", "fmt", "$folder"], "selector": "source.zig", - "name": "Format Project" + "name": "Format Project", + "quiet": true }, ] } diff --git a/Settings/Zig.sublime-settings b/Settings/Zig.sublime-settings index d2b3b72..f0317e9 100644 --- a/Settings/Zig.sublime-settings +++ b/Settings/Zig.sublime-settings @@ -1,6 +1,16 @@ { + // path to the zig compiler or just "zig" if it's in your PATH "zig.executable": "zig", + + // automatically build the file/project on save "zig.build.on_save": false, + + // automatically format the file/project on save "zig.fmt.on_save": true, + + // format either file or project. the only valid options are "file" or "project" "zig.fmt.mode": "file", + + // automatically hide the build/fmt output panel + "zig.quiet": true, } diff --git a/Zig.py b/Zig.py index 859c4f0..61a19de 100644 --- a/Zig.py +++ b/Zig.py @@ -16,10 +16,12 @@ def on_post_save_async(self, view): if scope.find('source.zig') != -1: should_fmt = get_setting(view, 'zig.fmt.on_save', True) should_build = get_setting(view, 'zig.build.on_save', False) + is_quiet = get_setting(view, 'zig.quiet', True) if (should_fmt): mode = get_setting(view, 'zig.fmt.mode', 'File').title() view.window().run_command('build', {'variant': 'Format ' + mode}) - if (should_build): view.window().run_command('build') + if (is_quiet): + view.window().run_command("hide_panel") \ No newline at end of file