diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-02 20:16:54 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-02 20:16:54 +0200 |
| commit | 595bcac243cb9cdd87e7484ab102c86f3235db8a (patch) | |
| tree | c89c275b175933efc59e9cba68aff607d489a8e2 /src/widgets/luaeditor/treesitter.rs | |
| parent | de9ad07b2a4737713f1473641fe195d7e3023928 (diff) | |
add editor theme
Diffstat (limited to 'src/widgets/luaeditor/treesitter.rs')
| -rw-r--r-- | src/widgets/luaeditor/treesitter.rs | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/src/widgets/luaeditor/treesitter.rs b/src/widgets/luaeditor/treesitter.rs index 1474434..ecd782d 100644 --- a/src/widgets/luaeditor/treesitter.rs +++ b/src/widgets/luaeditor/treesitter.rs @@ -1,36 +1,6 @@ use tree_sitter_highlight::{Highlight, HighlightConfiguration, HighlightEvent, Highlighter}; -static HIGHLIGHT_NAMES: [&str; 29] = [ - "attribute", - "boolean", - "comment", - "conditional", - "constant", - "constant.builtin", - "constructor", - "field", - "function", - "function.builtin", - "function.call", - "keyword", - "keyword.function", - "keyword.operator", - "keyword.return", - "label", - "method", - "method.call", - "number", - "operator", - "parameter", - "preproc", - "punctuation.bracket", - "punctuation.delimiter", - "repeat", - "string", - "string.escape", - "variable", - "variable.builtin", -]; +use super::theme; pub fn new_highlight_configuration() -> HighlightConfiguration { let mut highlight_config = HighlightConfiguration::new( @@ -42,13 +12,13 @@ pub fn new_highlight_configuration() -> HighlightConfiguration { ) .unwrap(); - highlight_config.configure(&HIGHLIGHT_NAMES); + highlight_config.configure(&theme::HIGHLIGHT_NAMES); highlight_config } pub fn highlight_name(h: Highlight) -> &'static str { - HIGHLIGHT_NAMES[h.0] + theme::HIGHLIGHT_NAMES[h.0] } pub fn highlighter_split<'a>( |