Skip to content

Commit aeab9e2

Browse files
committed
cleaned up directory and added \u{...} syntax
1 parent 30df767 commit aeab9e2

File tree

8 files changed

+34
-16
lines changed

8 files changed

+34
-16
lines changed
File renamed without changes.
File renamed without changes.

Support/Main.sublime-menu

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[
2+
{
3+
"id": "preferences",
4+
"children":
5+
[
6+
{
7+
"id": "package-settings",
8+
"children":
9+
[
10+
{
11+
"caption": "Zig",
12+
"children":
13+
[
14+
{
15+
"command": "edit_settings", "args":
16+
{
17+
"base_file": "${packages}/User/Zig.sublime-settings",
18+
"default": "{\n\t$0\n}\n"
19+
},
20+
"caption": "Settings"
21+
},
22+
]
23+
}
24+
]
25+
}
26+
]
27+
}
28+
]
File renamed without changes.

Zig.YAML-tmLanguage renamed to Syntaxes/Zig.YAML-tmLanguage

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ repository:
156156
- name: string.quoted.escape.hexidecimal.zig
157157
match: \\x[a-fA-F0-9]{2}
158158
- name: string.quoted.escape.hexidecimal.zig
159-
match: \\u[a-fA-F0-9]{4}
160-
- name: string.quoted.escape.hexidecimal.zig
161-
match: \\U[a-fA-F0-9]{6}
159+
match: \\u\{[a-fA-F0-9]{1,6}\}
162160
163161
character:
164162
begin: (\')

Zig.tmLanguage renamed to Syntaxes/Zig.tmLanguage

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,7 @@
269269
</dict>
270270
<dict>
271271
<key>match</key>
272-
<string>\\u[a-fA-F0-9]{4}</string>
273-
<key>name</key>
274-
<string>string.quoted.escape.hexidecimal.zig</string>
275-
</dict>
276-
<dict>
277-
<key>match</key>
278-
<string>\\U[a-fA-F0-9]{6}</string>
272+
<string>\\u\{[a-fA-F0-9]{1,6}\}</string>
279273
<key>name</key>
280274
<string>string.quoted.escape.hexidecimal.zig</string>
281275
</dict>

Zig.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ def fmt(fmt, dic):
77
return fmt
88

99
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-
}))
10+
def on_post_save_async(self, view):
11+
global_settings = sublime.load_settings(fmt("{name}.sublime-settings", { "name": self.__class__.__name__ }))
1412
should_fmt = view.settings().get('fmt.on_save.enabled', global_settings.get('fmt.on_save.enabled'))
1513
if (should_fmt):
1614
view.window().run_command("build", {"variant": "Format File"})

Zig.sublime-settings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"zig": "zig",
3-
"fmt.on_save.enabled": false,
2+
"zig.executable": "zig",
3+
"zig.fmt.on_save": true,
44
}

0 commit comments

Comments
 (0)