From ef0d062b1fd202fe89bc4bbd33826c46f660ef70 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Sun, 13 Dec 2020 13:29:34 +0900 Subject: Fix cursor positioning. --- helix-term/src/prompt.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'helix-term/src/prompt.rs') 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 { + Some(Position::new( + area.height as usize - 1, + area.x as usize + 2 + self.cursor, + )) + } } -- cgit v1.2.3-70-g09d2