@@ -281,22 +281,23 @@ impl EditorView {
281281 let end = text.line_to_char(last_line + 1);
282282 Range::new(start, end)
283283 };
284− let scope = match doc.mode() {
285− Mode::Insert => "ui.cursor.insert",
286− Mode::Select => "ui.cursor.select",
287− Mode::Normal => "ui.cursor",
288− };
289− let cursor_style = theme.try_get(scope).unwrap_or_else(|| {
290− theme
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))
294− });
284+
285+ let base_cursor_style = theme
286+ .try_get("ui.cursor")
287+ .unwrap_or_else(|| Style::default().add_modifier(Modifier::REVERSED));
288+ let cursor_style = match doc.mode() {
289+ Mode::Insert => theme.try_get("ui.cursor.insert"),
290+ Mode::Select => theme.try_get("ui.cursor.select"),
291+ Mode::Normal => Some(base_cursor_style),
292+ }
293+ .unwrap_or(base_cursor_style);
294+ let primary_cursor_style = theme.try_get("ui.cursor.primary").unwrap_or(cursor_style);
295295
296296 let selection_style = theme.get("ui.selection");
297− let primary_style = theme
297+ let primary_selection_style = theme
298298 .try_get("ui.selection.primary")
299299 .unwrap_or(selection_style);
300+
300301 let selection = doc.selection(view.id);
301302 let primary_idx = selection.primary_index();
302303
@@ -309,10 +310,10 @@ impl EditorView {
309310 let mut start = view.screen_coords_at_pos(doc, text, selection.anchor);
310311 let mut end = view.screen_coords_at_pos(doc, text, selection.head);
311312
312− let style = if i != primary_idx {
313− selection_style
313+ let (cursor_style, selection_style) = if i == primary_idx {
314+ (primary_cursor_style, primary_selection_style)
314315 } else {
315− primary_style
316+ (cursor_style, selection_style)
316317 };
317318
318319 let head = end;
@@ -342,7 +343,7 @@ impl EditorView {
342343 ),
343344 1,
344345 ),
345− style,
346+ selection_style,
346347 );
347348 } else {
348349 surface.set_style(
@@ -353,7 +354,7 @@ impl EditorView {
353354 viewport.width.saturating_sub(start.col as u16),
354355 1,
355356 ),
356− style,
357+ selection_style,
357358 );
358359 for i in start.row + 1..end.row {
359360 surface.set_style(
@@ -364,7 +365,7 @@ impl EditorView {
364365 viewport.width,
365366 1,
366367 ),
367− style,
368+ selection_style,
368369 );
369370 }
370371 surface.set_style(
@@ -374,7 +375,7 @@ impl EditorView {
374375 (end.col as u16).min(viewport.width),
375376 1,
376377 ),
377− style,
378+ selection_style,
378379 );
379380 }
380381