We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6625198 commit 30df767Copy full SHA for 30df767
Zig.py
@@ -0,0 +1,16 @@
1
+import sublime
2
+import sublime_plugin
3
+
4
+def fmt(fmt, dic):
5
+ for k in dic:
6
+ fmt = fmt.replace("{" + k + "}", str(dic[k]))
7
+ return fmt
8
9
+class Zig(sublime_plugin.EventListener):
10
+ def on_post_save(self, view):
11
+ global_settings = sublime.load_settings(fmt("{package}.sublime-settings", {
12
+ "package": self.__class__.__name__,
13
+ }))
14
+ should_fmt = view.settings().get('fmt.on_save.enabled', global_settings.get('fmt.on_save.enabled'))
15
+ if (should_fmt):
16
+ view.window().run_command("build", {"variant": "Format File"})
Zig.sublime-settings
@@ -0,0 +1,4 @@
+{
+ "zig": "zig",
+ "fmt.on_save.enabled": false,
+}
0 commit comments