From 078e5900a4726b51c97bd2a9822e856db8a54e73 Mon Sep 17 00:00:00 2001 From: James Wainwright <105280833+jwnrt@users.noreply.github.com> Date: Tue, 1 Nov 2022 21:29:07 +0000 Subject: [PATCH 2/2] Add "union" as a keyword for Rust syntax --- rc/filetype/rust.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 26e110e4..920ed2b4 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -86,7 +86,7 @@ add-highlighter shared/rust/code/question_mark regex \? 0:meta add-highlighter shared/rust/code/function_call regex _?[a-zA-Z]\w*\s*(?=\() 0:function add-highlighter shared/rust/code/generic_function_call regex _?[a-zA-Z]\w*\s*(?=::<) 0:function add-highlighter shared/rust/code/function_declaration regex (?:fn\h+)(_?\w+)(?:<[^>]+?>)?\( 1:function -add-highlighter shared/rust/code/keywords regex \b(?:as|break|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|pub|return|self|Self|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|try)\b 0:keyword +add-highlighter shared/rust/code/keywords regex \b(?:as|break|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|pub|return|self|Self|struct|super|trait|true|type|union|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|try)\b 0:keyword add-highlighter shared/rust/code/storage regex \b(move|mut|ref|static|const)\b 0:type add-highlighter shared/rust/code/pub_with_scope regex \b(pub)\h*(\()\h*(crate|super|self|in\h+[\w:]+)\h*(\)) 1:keyword 2:meta 4:meta # after let can be an arbitrary pattern match