Skip to content

Commit e8f68cd

Browse files
committed
fix #36
1 parent 99c8b18 commit e8f68cd

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

Build Systems/Zig.sublime-build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
{
2020
"cmd": ["zig", "fmt", "$file"],
2121
"selector": "source.zig",
22-
"name": "Format File"
22+
"name": "Format File",
23+
"quiet": true,
2324
},
2425
{
2526
"cmd": ["zig", "build", "test"],
@@ -36,7 +37,8 @@
3637
{
3738
"cmd": ["zig", "fmt", "$folder"],
3839
"selector": "source.zig",
39-
"name": "Format Project"
40+
"name": "Format Project",
41+
"quiet": true
4042
},
4143
]
4244
}

Settings/Zig.sublime-settings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
{
2+
// path to the zig compiler or just "zig" if it's in your PATH
23
"zig.executable": "zig",
4+
5+
// automatically build the file/project on save
36
"zig.build.on_save": false,
7+
8+
// automatically format the file/project on save
49
"zig.fmt.on_save": true,
10+
11+
// format either file or project. the only valid options are "file" or "project"
512
"zig.fmt.mode": "file",
13+
14+
// automatically hide the build/fmt output panel
15+
"zig.quiet": true,
616
}

Zig.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ def on_post_save_async(self, view):
1616
if scope.find('source.zig') != -1:
1717
should_fmt = get_setting(view, 'zig.fmt.on_save', True)
1818
should_build = get_setting(view, 'zig.build.on_save', False)
19+
is_quiet = get_setting(view, 'zig.quiet', True)
1920

2021
if (should_fmt):
2122
mode = get_setting(view, 'zig.fmt.mode', 'File').title()
2223
view.window().run_command('build', {'variant': 'Format ' + mode})
23-
2424
if (should_build):
2525
view.window().run_command('build')
26+
if (is_quiet):
27+
view.window().run_command("hide_panel")

0 commit comments

Comments
 (0)