From 5989ba88e7a3bb350b9103e89377354be9dd47e7 Mon Sep 17 00:00:00 2001 From: s0LA1337 Date: Sat, 1 Oct 2022 20:13:44 +0000 Subject: [PATCH] Adjust to use rainbow style array in themes --- helix-term/src/ui/editor.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index e28a95d9..6a26d0c4 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -421,15 +421,6 @@ impl EditorView { let text_style = theme.get("ui.text"); let whitespace_style = theme.get("ui.virtual.whitespace"); - let indent_rainbow_colors = [ - helix_view::graphics::Color::Red, - helix_view::graphics::Color::Yellow, - helix_view::graphics::Color::Green, - helix_view::graphics::Color::Cyan, - helix_view::graphics::Color::Blue, - helix_view::graphics::Color::Magenta, - ]; - let mut is_in_indent_area = true; let mut last_line_indent_level = 0; @@ -451,8 +442,8 @@ impl EditorView { for i in starting_indent..(indent_level / tab_width as u16) { if config.indent_guides.rainbow { - let color_index: usize = i as usize % indent_rainbow_colors.len(); - indent_guide_style.fg = Some(indent_rainbow_colors[color_index]); + let color_index: usize = i as usize % theme.rainbow_length(); + indent_guide_style.fg = theme.get(&format!("rainbow.{}", color_index)).fg; } surface.set_string(