diff options
author | Michael Davis | 2024-05-01 22:52:02 +0000 |
---|---|---|
committer | JJ | 2024-05-01 23:54:41 +0000 |
commit | 9a3f23b0661f7a37a0dab885fe5eb844b615a22b (patch) | |
tree | 48a816a487a38bf3145263a61d96c4a06d28765f /helix-view/src/editor.rs | |
parent | 214f7ba218223cd292fb1788ad203e5168657975 (diff) |
Add rainbow tree-sitter highlights
ref: https://github.com/helix-editor/helix/issues/695
ref: https://github.com/helix-editor/helix/pull/2857
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r-- | helix-view/src/editor.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 8013043f..4987c073 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -356,6 +356,8 @@ pub struct Config { pub initial_mode: Mode, /// User supplied digraphs for use with the `insert_diagraphs` command pub digraphs: DigraphStore, + /// Whether to render rainbow highlights. Defaults to `true`. + pub rainbow_brackets: bool, } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Eq, PartialOrd, Ord)] @@ -936,6 +938,7 @@ impl Default for Config { explorer: ExplorerConfig::default(), initial_mode: Mode::Normal, digraphs: Default::default(), + rainbow_brackets: true, } } } @@ -1276,8 +1279,9 @@ impl Editor { return; } - let scopes = theme.scopes(); - (*self.syn_loader).load().set_scopes(scopes.to_vec()); + self.syn_loader + .load_full() + .set_scopes(theme.scopes().to_vec()); match preview { ThemeAction::Preview => { |