diff options
author | Blaž Hrastnik | 2022-06-21 16:38:21 +0000 |
---|---|---|
committer | GitHub | 2022-06-21 16:38:21 +0000 |
commit | 458b89e21dcf76bbf9ca6ba237bd334f4922722d (patch) | |
tree | f859642d007db7274d3cd657ecaa59b1ec014cd8 /helix-term/src/ui | |
parent | 5f7c247430998fabceb55d4689118dd75e2bdfb1 (diff) | |
parent | 6a3f7f2c399f0b92cef97b0c85ebe976fd7cfcac (diff) |
Merge branch 'master' into test-harness
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 8 |
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) } |