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/editor.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/editor.rs')
-rw-r--r-- | helix-term/src/ui/editor.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 5913df29..95587b4c 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -26,6 +26,7 @@ use tui::{ buffer::Buffer as Surface, layout::Rect, style::{Color, Modifier, Style}, + terminal::CursorKind, }; pub struct EditorView { @@ -739,15 +740,12 @@ impl Component for EditorView { } } - fn cursor_position(&self, area: Rect, editor: &Editor) -> Option<Position> { + fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) { // match view.doc.mode() { // Mode::Insert => write!(stdout, "\x1B[6 q"), // mode => write!(stdout, "\x1B[2 q"), // }; - // return editor.cursor_position() - - // It's easier to just not render the cursor and use selection rendering instead. - None + editor.cursor() } } |