From 124514aa7024b0cf40bf01def54d280fcc86897c Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Tue, 15 Jun 2021 13:03:56 +0800 Subject: Add cursor kind to separate hidden cursor from pos Now IME cursor position should be correct since we can still set cursor position without drawing the cursor. --- helix-term/src/ui/picker.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'helix-term/src/ui/picker.rs') diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 20d51d5d..0aec9894 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -16,6 +16,7 @@ use crate::ui::{Prompt, PromptEvent}; use helix_core::Position; use helix_view::editor::Action; use helix_view::Editor; +use tui::terminal::CursorKind; pub struct Picker { options: Vec, @@ -304,7 +305,7 @@ impl Component for Picker { } } - fn cursor_position(&self, area: Rect, editor: &Editor) -> Option { + fn cursor(&self, area: Rect, editor: &Editor) -> (Option, CursorKind) { // TODO: this is mostly duplicate code let area = inner_rect(area); let block = Block::default().borders(Borders::ALL); @@ -314,6 +315,6 @@ impl Component for Picker { // prompt area let area = Rect::new(inner.x + 1, inner.y, inner.width - 1, 1); - self.prompt.cursor_position(area, editor) + self.prompt.cursor(area, editor) } } -- cgit v1.2.3-70-g09d2