on master help sign in
Merge branch 'master' into debug
commit48cb81eff13f3f33d85f3bff731df4f9db1e4659 authorDmitry Sharshakov <d3dx12.xx@gmail.com> dateSat 9 Oct 2021, 16:03 (5 years ago) parent814dcfa8925fdd
9 files changed+276−150
Cargo.lock+8−8 book/src/keymap.md+4−4 helix-core/Cargo.toml+2−2 helix-lsp/Cargo.toml+3−3 helix-syntax/languages/tree-sitter-zig+1−1 helix-term/src/commands.rs+52−48 runtime/queries/zig/highlights.scm+117−80 runtime/queries/zig/indents.toml+5−4 runtime/themes/nord.toml+84
Cargo.lock+8−8
@@ -599,9 +599,9 @@ dependencies = [
599599
600600[[package]]
601601name = "lsp-types"
602−version = "0.89.2"
602+version = "0.90.0"
603603source = "registry+https://github.com/rust-lang/crates.io-index"
604−checksum = "852e0dedfd52cc32325598b2631e0eba31b7b708959676a9f837042f276b09a2"
604+checksum = "a7404037aab080771c90b0a499836d9d8a10336ecd07badf969567b65c6d51a1"
605605dependencies = [
606606 "bitflags",
607607 "serde",
@@ -966,9 +966,9 @@ dependencies = [
966966
967967[[package]]
968968name = "similar"
969−version = "2.0.0"
969+version = "2.1.0"
970970source = "registry+https://github.com/rust-lang/crates.io-index"
971−checksum = "6bf11003835e462f07851028082d2a1c89d956180ce4b4b50e07fb085ec4131a"
971+checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3"
972972
973973[[package]]
974974name = "slab"
@@ -987,9 +987,9 @@ dependencies = [
987987
988988[[package]]
989989name = "smallvec"
990−version = "1.6.1"
990+version = "1.7.0"
991991source = "registry+https://github.com/rust-lang/crates.io-index"
992−checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
992+checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
993993
994994[[package]]
995995name = "str-buf"
@@ -1074,9 +1074,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
10741074
10751075[[package]]
10761076name = "tokio"
1077−version = "1.11.0"
1077+version = "1.12.0"
10781078source = "registry+https://github.com/rust-lang/crates.io-index"
1079−checksum = "b4efe6fc2395938c8155973d7be49fe8d03a843726e285e100a8a383cc0154ce"
1079+checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc"
10801080dependencies = [
10811081 "autocfg",
10821082 "bytes",
book/src/keymap.md+4−4
@@ -88,10 +88,10 @@
8888| `,` | Keep only the primary selection | `keep_primary_selection` |
8989| `C` | Copy selection onto the next line | `copy_selection_on_next_line` |
9090| `Alt-C` | Copy selection onto the previous line | `copy_selection_on_prev_line` |
91−| `(` | Rotate main selection forward | `rotate_selections_backward` |
92−| `)` | Rotate main selection backward | `rotate_selections_forward` |
93−| `Alt-(` | Rotate selection contents forward | `rotate_selection_contents_backward` |
94−| `Alt-)` | Rotate selection contents backward | `rotate_selection_contents_forward` |
91+| `(` | Rotate main selection backward | `rotate_selections_backward` |
92+| `)` | Rotate main selection forward | `rotate_selections_forward` |
93+| `Alt-(` | Rotate selection contents backward | `rotate_selection_contents_backward` |
94+| `Alt-)` | Rotate selection contents forward | `rotate_selection_contents_forward` |
9595| `%` | Select entire file | `select_all` |
9696| `x` | Select current line, if already selected, extend to next line | `extend_line` |
9797| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
helix-core/Cargo.toml+2−2
@@ -17,7 +17,7 @@ helix-syntax = { version = "0.4", path = "../helix-syntax" }
1717helix-dap = { version = "0.4", path = "../helix-dap" }
1818
1919ropey = "1.3"
20−smallvec = "1.4"
20+smallvec = "1.7"
2121tendril = "0.4.2"
2222unicode-segmentation = "1.8"
2323unicode-width = "0.1"
@@ -31,7 +31,7 @@ regex = "1"
3131serde = { version = "1.0", features = ["derive"] }
3232toml = "0.5"
3333
34−similar = "2.0"
34+similar = "2.1"
3535
3636etcetera = "0.3"
3737
helix-lsp/Cargo.toml+3−3
@@ -19,9 +19,9 @@ futures-executor = "0.3"
1919futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false }
2020jsonrpc-core = { version = "18.0", default-features = false } # don't pull in all of futures
2121log = "0.4"
22−lsp-types = { version = "0.89", features = ["proposed"] }
22+lsp-types = { version = "0.90", features = ["proposed"] }
2323serde = { version = "1.0", features = ["derive"] }
2424serde_json = "1.0"
2525thiserror = "1.0"
26−tokio = { version = "1.11", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] }
27−tokio-stream = "0.1"
26+tokio = { version = "1.12", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] }
27+tokio-stream = "0.1.7"
helix-syntax/languages/tree-sitter-zig+1−1

Submodule changed.

helix-term/src/commands.rs+52−48
@@ -1310,6 +1310,7 @@ fn global_search(cx: &mut Context) {
13101310
13111311 cx.push_layer(Box::new(prompt));
13121312
1313+ let root = find_root(None).unwrap_or_else(|| PathBuf::from("./"));
13131314 let show_picker = async move {
13141315 let all_matches: Vec<(usize, PathBuf)> =
13151316 UnboundedReceiverStream::new(all_matches_rx).collect().await;
@@ -1321,7 +1322,13 @@ fn global_search(cx: &mut Context) {
13211322 }
13221323 let picker = FilePicker::new(
13231324 all_matches,
1324− move |(_line_num, path)| path.to_str().unwrap().into(),
1325+ move |(_line_num, path)| {
1326+ path.strip_prefix(&root)
1327+ .unwrap_or(path)
1328+ .to_str()
1329+ .unwrap()
1330+ .into()
1331+ },
13251332 move |editor: &mut Editor, (line_num, path), action| {
13261333 match editor.open(path.into(), action) {
13271334 Ok(_) => {}
@@ -1504,7 +1511,7 @@ mod cmd {
15041511 #[derive(Clone)]
15051512 pub struct TypableCommand {
15061513 pub name: &'static str,
1507− pub alias: Option<&'static str>,
1514+ pub aliases: &'static [&'static str],
15081515 pub doc: &'static str,
15091516 // params, flags, helper, completer
15101517 pub fun: fn(&mut compositor::Context, &[&str], PromptEvent) -> anyhow::Result<()>,
@@ -2178,238 +2185,238 @@ mod cmd {
21782185 pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
21792186 TypableCommand {
21802187 name: "quit",
2181− alias: Some("q"),
2188+ aliases: &["q"],
21822189 doc: "Close the current view.",
21832190 fun: quit,
21842191 completer: None,
21852192 },
21862193 TypableCommand {
21872194 name: "quit!",
2188− alias: Some("q!"),
2195+ aliases: &["q!"],
21892196 doc: "Close the current view.",
21902197 fun: force_quit,
21912198 completer: None,
21922199 },
21932200 TypableCommand {
21942201 name: "open",
2195− alias: Some("o"),
2202+ aliases: &["o"],
21962203 doc: "Open a file from disk into the current view.",
21972204 fun: open,
21982205 completer: Some(completers::filename),
21992206 },
22002207 TypableCommand {
22012208 name: "write",
2202− alias: Some("w"),
2209+ aliases: &["w"],
22032210 doc: "Write changes to disk. Accepts an optional path (:write some/path.txt)",
22042211 fun: write,
22052212 completer: Some(completers::filename),
22062213 },
22072214 TypableCommand {
22082215 name: "new",
2209− alias: Some("n"),
2216+ aliases: &["n"],
22102217 doc: "Create a new scratch buffer.",
22112218 fun: new_file,
22122219 completer: Some(completers::filename),
22132220 },
22142221 TypableCommand {
22152222 name: "format",
2216− alias: Some("fmt"),
2223+ aliases: &["fmt"],
22172224 doc: "Format the file using a formatter.",
22182225 fun: format,
22192226 completer: None,
22202227 },
22212228 TypableCommand {
22222229 name: "indent-style",
2223− alias: None,
2230+ aliases: &[],
22242231 doc: "Set the indentation style for editing. ('t' for tabs or 1-8 for number of spaces.)",
22252232 fun: set_indent_style,
22262233 completer: None,
22272234 },
22282235 TypableCommand {
22292236 name: "line-ending",
2230− alias: None,
2237+ aliases: &[],
22312238 doc: "Set the document's default line ending. Options: crlf, lf, cr, ff, nel.",
22322239 fun: set_line_ending,
22332240 completer: None,
22342241 },
22352242 TypableCommand {
22362243 name: "earlier",
2237− alias: Some("ear"),
2244+ aliases: &["ear"],
22382245 doc: "Jump back to an earlier point in edit history. Accepts a number of steps or a time span.",
22392246 fun: earlier,
22402247 completer: None,
22412248 },
22422249 TypableCommand {
22432250 name: "later",
2244− alias: Some("lat"),
2251+ aliases: &["lat"],
22452252 doc: "Jump to a later point in edit history. Accepts a number of steps or a time span.",
22462253 fun: later,
22472254 completer: None,
22482255 },
22492256 TypableCommand {
22502257 name: "write-quit",
2251− alias: Some("wq"),
2258+ aliases: &["wq", "x"],
22522259 doc: "Writes changes to disk and closes the current view. Accepts an optional path (:wq some/path.txt)",
22532260 fun: write_quit,
22542261 completer: Some(completers::filename),
22552262 },
22562263 TypableCommand {
22572264 name: "write-quit!",
2258− alias: Some("wq!"),
2265+ aliases: &["wq!", "x!"],
22592266 doc: "Writes changes to disk and closes the current view forcefully. Accepts an optional path (:wq! some/path.txt)",
22602267 fun: force_write_quit,
22612268 completer: Some(completers::filename),
22622269 },
22632270 TypableCommand {
22642271 name: "write-all",
2265− alias: Some("wa"),
2272+ aliases: &["wa"],
22662273 doc: "Writes changes from all views to disk.",
22672274 fun: write_all,
22682275 completer: None,
22692276 },
22702277 TypableCommand {
22712278 name: "write-quit-all",
2272− alias: Some("wqa"),
2279+ aliases: &["wqa", "xa"],
22732280 doc: "Writes changes from all views to disk and close all views.",
22742281 fun: write_all_quit,
22752282 completer: None,
22762283 },
22772284 TypableCommand {
22782285 name: "write-quit-all!",
2279− alias: Some("wqa!"),
2286+ aliases: &["wqa!", "xa!"],
22802287 doc: "Writes changes from all views to disk and close all views forcefully (ignoring unsaved changes).",
22812288 fun: force_write_all_quit,
22822289 completer: None,
22832290 },
22842291 TypableCommand {
22852292 name: "quit-all",
2286− alias: Some("qa"),
2293+ aliases: &["qa"],
22872294 doc: "Close all views.",
22882295 fun: quit_all,
22892296 completer: None,
22902297 },
22912298 TypableCommand {
22922299 name: "quit-all!",
2293− alias: Some("qa!"),
2300+ aliases: &["qa!"],
22942301 doc: "Close all views forcefully (ignoring unsaved changes).",
22952302 fun: force_quit_all,
22962303 completer: None,
22972304 },
22982305 TypableCommand {
22992306 name: "theme",
2300− alias: None,
2307+ aliases: &[],
23012308 doc: "Change the theme of current view. Requires theme name as argument (:theme <name>)",
23022309 fun: theme,
23032310 completer: Some(completers::theme),
23042311 },
23052312 TypableCommand {
23062313 name: "clipboard-yank",
2307− alias: None,
2314+ aliases: &[],
23082315 doc: "Yank main selection into system clipboard.",
23092316 fun: yank_main_selection_to_clipboard,
23102317 completer: None,
23112318 },
23122319 TypableCommand {
23132320 name: "clipboard-yank-join",
2314− alias: None,
2321+ aliases: &[],
23152322 doc: "Yank joined selections into system clipboard. A separator can be provided as first argument. Default value is newline.", // FIXME: current UI can't display long doc.
23162323 fun: yank_joined_to_clipboard,
23172324 completer: None,
23182325 },
23192326 TypableCommand {
23202327 name: "primary-clipboard-yank",
2321− alias: None,
2328+ aliases: &[],
23222329 doc: "Yank main selection into system primary clipboard.",
23232330 fun: yank_main_selection_to_primary_clipboard,
23242331 completer: None,
23252332 },
23262333 TypableCommand {
23272334 name: "primary-clipboard-yank-join",
2328− alias: None,
2335+ aliases: &[],
23292336 doc: "Yank joined selections into system primary clipboard. A separator can be provided as first argument. Default value is newline.", // FIXME: current UI can't display long doc.
23302337 fun: yank_joined_to_primary_clipboard,
23312338 completer: None,
23322339 },
23332340 TypableCommand {
23342341 name: "clipboard-paste-after",
2335− alias: None,
2342+ aliases: &[],
23362343 doc: "Paste system clipboard after selections.",
23372344 fun: paste_clipboard_after,
23382345 completer: None,
23392346 },
23402347 TypableCommand {
23412348 name: "clipboard-paste-before",
2342− alias: None,
2349+ aliases: &[],
23432350 doc: "Paste system clipboard before selections.",
23442351 fun: paste_clipboard_before,
23452352 completer: None,
23462353 },
23472354 TypableCommand {
23482355 name: "clipboard-paste-replace",
2349− alias: None,
2356+ aliases: &[],
23502357 doc: "Replace selections with content of system clipboard.",
23512358 fun: replace_selections_with_clipboard,
23522359 completer: None,
23532360 },
23542361 TypableCommand {
23552362 name: "primary-clipboard-paste-after",
2356− alias: None,
2363+ aliases: &[],
23572364 doc: "Paste primary clipboard after selections.",
23582365 fun: paste_primary_clipboard_after,
23592366 completer: None,
23602367 },
23612368 TypableCommand {
23622369 name: "primary-clipboard-paste-before",
2363− alias: None,
2370+ aliases: &[],
23642371 doc: "Paste primary clipboard before selections.",
23652372 fun: paste_primary_clipboard_before,
23662373 completer: None,
23672374 },
23682375 TypableCommand {
23692376 name: "primary-clipboard-paste-replace",
2370− alias: None,
2377+ aliases: &[],
23712378 doc: "Replace selections with content of system primary clipboard.",
23722379 fun: replace_selections_with_primary_clipboard,
23732380 completer: None,
23742381 },
23752382 TypableCommand {
23762383 name: "show-clipboard-provider",
2377− alias: None,
2384+ aliases: &[],
23782385 doc: "Show clipboard provider name in status bar.",
23792386 fun: show_clipboard_provider,
23802387 completer: None,
23812388 },
23822389 TypableCommand {
23832390 name: "change-current-directory",
2384− alias: Some("cd"),
2391+ aliases: &["cd"],
23852392 doc: "Change the current working directory (:cd <dir>).",
23862393 fun: change_current_directory,
23872394 completer: Some(completers::directory),
23882395 },
23892396 TypableCommand {
23902397 name: "show-directory",
2391− alias: Some("pwd"),
2398+ aliases: &["pwd"],
23922399 doc: "Show the current working directory.",
23932400 fun: show_current_directory,
23942401 completer: None,
23952402 },
23962403 TypableCommand {
23972404 name: "encoding",
2398− alias: None,
2405+ aliases: &[],
23992406 doc: "Set encoding based on `https://encoding.spec.whatwg.org`",
24002407 fun: set_encoding,
24012408 completer: None,
24022409 },
24032410 TypableCommand {
24042411 name: "reload",
2405− alias: None,
2412+ aliases: &[],
24062413 doc: "Discard changes and reload from the source file.",
24072414 fun: reload,
24082415 completer: None,
24092416 },
24102417 TypableCommand {
24112418 name: "tree-sitter-scopes",
2412− alias: None,
2419+ aliases: &[],
24132420 doc: "Display tree sitter scopes, primarily for theming and development.",
24142421 fun: tree_sitter_scopes,
24152422 completer: None,
@@ -2437,14 +2444,14 @@ mod cmd {
24372444 },
24382445 TypableCommand {
24392446 name: "vsplit",
2440− alias: Some("vs"),
2447+ aliases: &["vs"],
24412448 doc: "Open the file in a vertical split.",
24422449 fun: vsplit,
24432450 completer: Some(completers::filename),
24442451 },
24452452 TypableCommand {
24462453 name: "hsplit",
2447− alias: Some("sp"),
2454+ aliases: &["hs", "sp"],
24482455 doc: "Open the file in a horizontal split.",
24492456 fun: hsplit,
24502457 completer: Some(completers::filename),
@@ -2452,16 +2459,13 @@ mod cmd {
24522459 ];
24532460
24542461 pub static COMMANDS: Lazy<HashMap<&'static str, &'static TypableCommand>> = Lazy::new(|| {
2455− let mut map = HashMap::new();
2456−
2457− for cmd in TYPABLE_COMMAND_LIST {
2458− map.insert(cmd.name, cmd);
2459− if let Some(alias) = cmd.alias {
2460− map.insert(alias, cmd);
2461− }
2462− }
2463−
2464− map
2462+ TYPABLE_COMMAND_LIST
2463+ .iter()
2464+ .flat_map(|cmd| {
2465+ std::iter::once((cmd.name, cmd))
2466+ .chain(cmd.aliases.iter().map(move |&alias| (alias, cmd)))
2467+ })
2468+ .collect()
24652469 });
24662470}
24672471
runtime/queries/zig/highlights.scm+117−80
@@ -4,82 +4,89 @@
44 (line_comment)
55] @comment
66
7−; field in top level decl, and in struct, union...
8−(ContainerField
9− (IDENTIFIER) @property
10− (SuffixExpr (IDENTIFIER) @type)?
11−)
7+[
8+ variable: (IDENTIFIER)
9+ variable_type_function: (IDENTIFIER)
10+] @variable
1211
13−; error.OutOfMemory;
14−(SuffixExpr
15− "error"
16− "."
17− (IDENTIFIER) @constant
12+parameter: (IDENTIFIER) @variable.parameter
13+
14+[
15+ field_member: (IDENTIFIER)
16+ field_access: (IDENTIFIER)
17+] @variable.property
18+
19+;; assume TitleCase is a type
20+(
21+ [
22+ variable_type_function: (IDENTIFIER)
23+ field_access: (IDENTIFIER)
24+ parameter: (IDENTIFIER)
25+ ] @type
26+ (#match? @type "^[A-Z]([a-z]+[A-Za-z0-9]*)*$")
27+)
28+;; assume camelCase is a function
29+(
30+ [
31+ variable_type_function: (IDENTIFIER)
32+ field_access: (IDENTIFIER)
33+ parameter: (IDENTIFIER)
34+ ] @function
35+ (#match? @function "^[a-z]+([A-Z][a-z0-9]*)+$")
1836)
1937
20−; var x: IDENTIFIER
21−type: (SuffixExpr (IDENTIFIER) @type)
38+;; assume all CAPS_1 is a constant
39+(
40+ [
41+ variable_type_function: (IDENTIFIER)
42+ field_access: (IDENTIFIER)
43+ ] @constant
44+ (#match? @constant "^[A-Z][A-Z_0-9]+$")
45+)
2246
23−; IDENTIFIER{}
24−constructor: (SuffixExpr (IDENTIFIER) @constructor)
47+[
48+ function_call: (IDENTIFIER)
49+ function: (IDENTIFIER)
50+] @function
2551
26−; fields
27−(FieldInit (IDENTIFIER) @property)
52+exception: "!" @function.macro
2853
29−; foo.bar.baz.function() calls
3054(
31− (SuffixOp
32− (IDENTIFIER) @function
33− )
34− .
35− (FnCallArguments)
55+ (IDENTIFIER) @variable.builtin
56+ (#eq? @variable.builtin "_")
3657)
3758
38−; function() calls
59+(PtrTypeStart "c" @variable.builtin)
60+
3961(
40− (
41− (IDENTIFIER) @function
62+ (ContainerDeclType
63+ [
64+ (ErrorUnionExpr)
65+ "enum"
66+ ]
4267 )
43− .
44− (FnCallArguments)
68+ (ContainerField (IDENTIFIER) @constant)
4569)
4670
47−; functionn decl
48−(FnProto
49− (IDENTIFIER) @function
50− (SuffixExpr (IDENTIFIER) @type)?
51− ("!")? @function.macro
52−)
71+field_constant: (IDENTIFIER) @constant
5372
54−; function parameters and types
55−(ParamDecl
56− (IDENTIFIER) @variable.parameter
57− ":"
58− [
59− (ParamType (SuffixExpr (IDENTIFIER) @type))
60− (ParamType)
61− ]
62−)
73+(BUILTINIDENTIFIER) @function.builtin
6374
64−; switch
65−(SwitchItem
66− (SuffixExpr
67− "."
68− .
69− (IDENTIFIER) @constant
70− )
71−)
75+((BUILTINIDENTIFIER) @keyword.control.import
76+ (#any-of? @keyword.control.import "@import" "@cImport"))
7277
7378(INTEGER) @number
7479
7580(FLOAT) @number
7681
7782[
78− (STRINGLITERAL)
83+ (LINESTRING)
7984 (STRINGLITERALSINGLE)
8085] @string
8186
82−(CHAR_LITERAL) @string
87+(CHAR_LITERAL) @constant.character
88+(EscapeSequence) @escape
89+(FormatSequence) @string.special
8390
8491[
8592 "allowzero"
@@ -95,6 +102,9 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor)
95102[
96103 "true"
97104 "false"
105+] @constant.builtin.boolean
106+
107+[
98108 "undefined"
99109 "unreachable"
100110 "null"
@@ -104,21 +114,18 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor)
104114 "else"
105115 "if"
106116 "switch"
117+] @keyword.control.conditional
118+
119+[
107120 "for"
108121 "while"
109− "return"
110− "break"
111− "continue"
112− "defer"
113− "errdefer"
114− "async"
115− "nosuspend"
116− "await"
117− "suspend"
118− "resume"
119− "try"
120− "catch"
121−] @keyword.control
122+] @keyword.control.repeat
123+
124+[
125+ "or"
126+ "and"
127+ "orelse"
128+] @operator
122129
123130[
124131 "struct"
@@ -127,21 +134,48 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor)
127134 "error"
128135 "packed"
129136 "opaque"
130− "test"
131− "usingnamespace"
132− "export"
133− "extern"
134− "const"
135− "var"
136− "comptime"
137− "threadlocal"
138137] @keyword
139138
140139[
141− "pub"
140+ "try"
141+ "error"
142+ "catch"
143+] @function.macro
144+
145+; VarDecl
146+[
147+ "comptime"
148+ "threadlocal"
142149 "fn"
143150] @keyword.function
144151
152+[
153+ "const"
154+ "var"
155+ "test"
156+ "pub"
157+ "usingnamespace"
158+] @keyword
159+
160+[
161+ "return"
162+ "break"
163+ "continue"
164+] @keyword.control
165+
166+; Macro
167+[
168+ "defer"
169+ "errdefer"
170+ "async"
171+ "nosuspend"
172+ "await"
173+ "suspend"
174+ "resume"
175+ "export"
176+ "extern"
177+] @function.macro
178+
145179; PrecProc
146180[
147181 "inline"
@@ -149,10 +183,9 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor)
149183 "asm"
150184 "callconv"
151185 "noalias"
152−] @attribute
186+] @keyword.directive
153187
154188[
155− (BUILTINIDENTIFIER)
156189 "linksection"
157190 "align"
158191] @function.builtin
@@ -164,9 +197,6 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor)
164197 (AdditionOp)
165198 (MultiplyOp)
166199 (PrefixOp)
167− "or"
168− "and"
169− "orelse"
170200 "*"
171201 "**"
172202 "->"
@@ -174,6 +204,7 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor)
174204 ".?"
175205 ".*"
176206 "="
207+ "?"
177208] @operator
178209
179210[
@@ -186,6 +217,9 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor)
186217[
187218 ".."
188219 "..."
220+] @punctuation.special
221+
222+[
189223 "["
190224 "]"
191225 "("
@@ -195,4 +229,7 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor)
195229 (Payload "|")
196230 (PtrPayload "|")
197231 (PtrIndexPayload "|")
198−] @punctuation
232+] @punctuation.bracket
233+
234+; Error
235+(ERROR) @keyword
runtime/queries/zig/indents.toml+5−4
@@ -1,8 +1,9 @@
11indent = [
2− "block",
3− "match_block",
4− "arguments",
5− "parameters"
2+ "Block",
3+ "BlockExpr",
4+ "ContainerDecl",
5+ "SwitchExpr",
6+ "InitList"
67]
78
89outdent = [
runtime/themes/nord.tomlnew file+84
@@ -0,0 +1,84 @@
1+# Author : RayGervais<raygervais@hotmail.ca>
2+
3+# "ui.linenr.selected" = { fg = "#d8dee9" }
4+# "ui.text.focus" = { fg = "#e5ded6", modifiers= ["bold"] }
5+# "ui.menu.selected" = { fg = "#e5ded6", bg = "#313f4e" }
6+
7+# "info" = "#b48ead"
8+# "hint" = "#a3be8c"
9+
10+# Polar Night
11+# nord0 - background color
12+"ui.background" = { bg = "#2e3440" }
13+"ui.statusline.inactive" = { fg = "#d8dEE9", bg = "#2e3440" }
14+
15+
16+# nord1 - status bars, panels, modals, autocompletion
17+"ui.statusline" = { fg = "#88c0d0", bg = "#3b4252" }
18+"ui.popup" = { bg = "#232d38" }
19+"ui.window" = { bg = "#232d38" }
20+"ui.help" = { bg = "#232d38", fg = "#e5ded6" }
21+
22+# nord2 - active line, highlighting
23+"ui.selection" = { bg = "#434c5e" }
24+"ui.cursor.match" = { bg = "434c5e" }
25+
26+# nord3 - comments
27+"comment" = "#4c566a"
28+"ui.linenr" = { fg = "#4c566a" }
29+
30+# Snow Storm
31+# nord4 - cursor, variables, constants, attributes, fields
32+"ui.cursor.primary" = { fg = "#d8dee9", modifiers = ["reversed"] }
33+"attribute" = "#d8dee9"
34+"variable" = "#d8dee9"
35+"constant" = "#d8dee9"
36+"variable.builtin" = "#d8dee9"
37+"constant.builtin" = "#d8dee9"
38+"namespace" = "#d8dee9"
39+
40+# nord5 - suble UI text
41+
42+# nord6 - base text, punctuation
43+"ui.text" = { fg = "#eceff4" }
44+"punctuation" = "#eceff4"
45+
46+# Frost
47+# nord7 - classes, types, primiatives
48+"type" = "#8fbcbb"
49+"type.builtin" = { fg = "#8fbcbb"}
50+"label" = "#8fbcbb"
51+
52+# nord8 - declaration, methods, routines
53+"constructor" = "#88c0d0"
54+"function" = "#88c0d0"
55+"function.macro" = { fg = "#88c0d0" }
56+"function.builtin" = { fg = "#88c0d0" }
57+
58+# nord9 - operator, tags, units, punctuations
59+"punctuation.delimiter" = "#81a1c1"
60+"operator" = { fg = "#81a1c1" }
61+"property" = "#81a1c1"
62+
63+# nord10 - keywords, special
64+"keyword" = { fg = "#5e81ac" }
65+"keyword.directive" = "#5e81ac"
66+"variable.parameter" = "#5e81ac"
67+
68+# Aurora
69+# nord11 - error
70+"error" = "#bf616a"
71+
72+# nord12 - annotations, decorators
73+"special" = "#d08770"
74+"module" = "#d08770"
75+
76+# nord13 - warnings, escape characters, regex
77+"warning" = "#ebcb8b"
78+"escape" = { fg = "#ebcb8b" }
79+
80+# nord14 - strings
81+"string" = "#a3be8c"
82+
83+# nord15 - integer, floating point
84+"number" = "#b48ead"