diff options
author | Ivan Tham | 2021-06-15 05:03:56 +0000 |
---|---|---|
committer | Ivan Tham | 2021-06-15 15:46:21 +0000 |
commit | 124514aa7024b0cf40bf01def54d280fcc86897c (patch) | |
tree | e4fa3e9566755d40bd322578fd25f7de99b28377 /helix-term/src/ui/picker.rs | |
parent | 6bdf609caaf4eb1c137f503f147d1e4e4f3e8676 (diff) |
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.
Diffstat (limited to 'helix-term/src/ui/picker.rs')
-rw-r--r-- | helix-term/src/ui/picker.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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<T> { options: Vec<T>, @@ -304,7 +305,7 @@ impl<T: 'static> Component for Picker<T> { } } - fn cursor_position(&self, area: Rect, editor: &Editor) -> Option<Position> { + fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) { // TODO: this is mostly duplicate code let area = inner_rect(area); let block = Block::default().borders(Borders::ALL); @@ -314,6 +315,6 @@ impl<T: 'static> Component for Picker<T> { // 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) } } |