diff options
Diffstat (limited to 'helix-term/src/ui/prompt.rs')
-rw-r--r-- | helix-term/src/ui/prompt.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index c388c315..7b8af820 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -4,6 +4,7 @@ use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers}; use helix_core::Position; use helix_view::{Editor, Theme}; use std::{borrow::Cow, ops::RangeFrom}; +use tui::terminal::CursorKind; pub type Completion = (RangeFrom<usize>, Cow<'static, str>); @@ -342,11 +343,14 @@ impl Component for Prompt { self.render_prompt(area, surface, cx) } - fn cursor_position(&self, area: Rect, editor: &Editor) -> Option<Position> { + fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) { let line = area.height as usize - 1; - Some(Position::new( - area.y as usize + line, - area.x as usize + self.prompt.len() + self.cursor, - )) + ( + Some(Position::new( + area.y as usize + line, + area.x as usize + self.prompt.len() + self.cursor, + )), + CursorKind::Block, + ) } } |