@@ -281,22 +281,23 @@ impl EditorView {
281 let end = text.line_to_char(last_line + 1);
281 let end = text.line_to_char(last_line + 1);
282 Range::new(start, end)
282 Range::new(start, end)
285+ let base_cursor_style = theme
286+ .try_get("ui.cursor")
287+ .unwrap_or_else(|| Style::default().add_modifier(Modifier::REVERSED));
284− let scope = match doc.mode() {
288+ let cursor_style = match doc.mode() {
285− Mode::Insert => "ui.cursor.insert",
289+ Mode::Insert => theme.try_get("ui.cursor.insert"),
286− Mode::Select => "ui.cursor.select",
290+ Mode::Select => theme.try_get("ui.cursor.select"),
287− Mode::Normal => "ui.cursor",
291+ Mode::Normal => Some(base_cursor_style),
289− let cursor_style = theme.try_get(scope).unwrap_or_else(|| {
293+ .unwrap_or(base_cursor_style);
290− theme
294+ let primary_cursor_style = theme.try_get("ui.cursor.primary").unwrap_or(cursor_style);
291− //if cursor.insert or cursor.select was not present try to default to cursor
292− .try_get("ui.cursor")
293− .unwrap_or_else(|| Style::default().add_modifier(Modifier::REVERSED))
296 let selection_style = theme.get("ui.selection");
296 let selection_style = theme.get("ui.selection");
297− let primary_style = theme
297+ let primary_selection_style = theme
298 .try_get("ui.selection.primary")
298 .try_get("ui.selection.primary")
299 .unwrap_or(selection_style);
299 .unwrap_or(selection_style);
300 let selection = doc.selection(view.id);
301 let selection = doc.selection(view.id);
301 let primary_idx = selection.primary_index();
302 let primary_idx = selection.primary_index();
@@ -309,10 +310,10 @@ impl EditorView {
309 let mut start = view.screen_coords_at_pos(doc, text, selection.anchor);
310 let mut start = view.screen_coords_at_pos(doc, text, selection.anchor);
310 let mut end = view.screen_coords_at_pos(doc, text, selection.head);
311 let mut end = view.screen_coords_at_pos(doc, text, selection.head);
312− let style = if i != primary_idx {
313+ let (cursor_style, selection_style) = if i == primary_idx {
313− selection_style
314+ (primary_cursor_style, primary_selection_style)
315− primary_style
316+ (cursor_style, selection_style)
318 let head = end;
319 let head = end;
@@ -342,7 +343,7 @@ impl EditorView {
345− style,
346+ selection_style,
348 surface.set_style(
349 surface.set_style(
@@ -353,7 +354,7 @@ impl EditorView {
353 viewport.width.saturating_sub(start.col as u16),
354 viewport.width.saturating_sub(start.col as u16),
356− style,
357+ selection_style,
358 for i in start.row + 1..end.row {
359 for i in start.row + 1..end.row {
359 surface.set_style(
360 surface.set_style(
@@ -364,7 +365,7 @@ impl EditorView {
364 viewport.width,
365 viewport.width,
367− style,
368+ selection_style,
370 surface.set_style(
371 surface.set_style(
@@ -374,7 +375,7 @@ impl EditorView {
374 (end.col as u16).min(viewport.width),
375 (end.col as u16).min(viewport.width),
377− style,
378+ selection_style,