diff options
author | Blaž Hrastnik | 2020-12-13 04:29:34 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-12-13 04:30:19 +0000 |
commit | ef0d062b1fd202fe89bc4bbd33826c46f660ef70 (patch) | |
tree | 77c10da4a77557c358f440368ba6f5506a3b7c9f /helix-term/src/prompt.rs | |
parent | 8695415fbfe927250f68e93793660e3c4e4a70b4 (diff) |
Fix cursor positioning.
Diffstat (limited to 'helix-term/src/prompt.rs')
-rw-r--r-- | helix-term/src/prompt.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/helix-term/src/prompt.rs b/helix-term/src/prompt.rs index 4747c9f5..7f473ebc 100644 --- a/helix-term/src/prompt.rs +++ b/helix-term/src/prompt.rs @@ -1,5 +1,6 @@ use crate::compositor::{Component, Context, EventResult}; use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers}; +use helix_core::Position; use helix_view::Editor; use helix_view::Theme; use std::string::String; @@ -200,4 +201,11 @@ impl Component for Prompt { fn render(&self, area: Rect, surface: &mut Surface, cx: &mut Context) { self.render_prompt(area, surface, &cx.editor.theme) } + + fn cursor_position(&self, area: Rect, ctx: &mut Context) -> Option<Position> { + Some(Position::new( + area.height as usize - 1, + area.x as usize + 2 + self.cursor, + )) + } } |