aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index f074d9f1..a8027d1b 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -20,7 +20,7 @@ use helix_core::{
use helix_view::{
document::{Mode, SCRATCH_BUFFER_NAME},
editor::{CompleteAction, CursorShapeConfig},
- graphics::{CursorKind, Modifier, Rect, Style},
+ graphics::{Color, CursorKind, Modifier, Rect, Style},
input::KeyEvent,
keyboard::{KeyCode, KeyModifiers},
Document, Editor, Theme, View,
@@ -170,7 +170,9 @@ impl EditorView {
theme: &Theme,
) {
let editor_rulers = &editor.config().rulers;
- let ruler_theme = theme.get("ui.virtual.ruler");
+ let ruler_theme = theme
+ .try_get("ui.virtual.ruler")
+ .unwrap_or_else(|| Style::default().bg(Color::Red));
let rulers = doc
.language_config()
@@ -1046,7 +1048,7 @@ impl EditorView {
let mut selection = doc.selection(view.id).clone();
let primary = selection.primary_mut();
- *primary = Range::new(primary.anchor, pos);
+ *primary = primary.put_cursor(doc.text().slice(..), pos, true);
doc.set_selection(view.id, selection);
EventResult::Consumed(None)
}