aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/theme.rs
diff options
context:
space:
mode:
authorSoraTenshi2024-05-01 22:58:30 +0000
committerJJ2024-05-01 23:54:41 +0000
commit27cc594d8fb5fb9e28888e20bae14db6ac2bef83 (patch)
treeba698e290f0751403f599a97baa2071e71dad274 /helix-view/src/theme.rs
parent9a3f23b0661f7a37a0dab885fe5eb844b615a22b (diff)
Add rainbow indentation guides
ref: https://github.com/helix-editor/helix/issues/4010 ref: https://github.com/helix-editor/helix/pull/4493
Diffstat (limited to 'helix-view/src/theme.rs')
-rw-r--r--helix-view/src/theme.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs
index 16da247f..8236d370 100644
--- a/helix-view/src/theme.rs
+++ b/helix-view/src/theme.rs
@@ -383,6 +383,10 @@ impl Theme {
pub fn rainbow_length(&self) -> usize {
self.rainbow_length
}
+
+ pub fn get_rainbow(&self, index: usize) -> Style {
+ self.highlights[index % self.rainbow_length]
+ }
}
fn default_rainbow() -> Vec<Style> {