aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/editor.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 35cf77ab..a19eb213 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -342,23 +342,29 @@ impl EditorView {
let selection_scope = theme
.find_scope_index("ui.selection")
.expect("could not find `ui.selection` scope in the theme!");
+ let primary_selection_scope = theme
+ .find_scope_index("ui.selection.primary")
+ .unwrap_or(selection_scope);
let base_cursor_scope = theme
.find_scope_index("ui.cursor")
.unwrap_or(selection_scope);
+ let base_primary_cursor_scope = theme
+ .find_scope_index("ui.cursor.primary")
+ .unwrap_or(base_cursor_scope);
let cursor_scope = match mode {
Mode::Insert => theme.find_scope_index("ui.cursor.insert"),
Mode::Select => theme.find_scope_index("ui.cursor.select"),
- Mode::Normal => Some(base_cursor_scope),
+ Mode::Normal => theme.find_scope_index("ui.cursor.normal"),
}
.unwrap_or(base_cursor_scope);
- let primary_cursor_scope = theme
- .find_scope_index("ui.cursor.primary")
- .unwrap_or(cursor_scope);
- let primary_selection_scope = theme
- .find_scope_index("ui.selection.primary")
- .unwrap_or(selection_scope);
+ let primary_cursor_scope = match mode {
+ Mode::Insert => theme.find_scope_index("ui.cursor.primary.insert"),
+ Mode::Select => theme.find_scope_index("ui.cursor.primary.select"),
+ Mode::Normal => theme.find_scope_index("ui.cursor.primary.normal"),
+ }
+ .unwrap_or(base_primary_cursor_scope);
let mut spans: Vec<(usize, std::ops::Range<usize>)> = Vec::new();
for (i, range) in selection.iter().enumerate() {