aboutsummaryrefslogtreecommitdiff
path: root/helix-tui/src/terminal.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-tui/src/terminal.rs')
-rw-r--r--helix-tui/src/terminal.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/helix-tui/src/terminal.rs b/helix-tui/src/terminal.rs
index e8f8f359..b9b2437a 100644
--- a/helix-tui/src/terminal.rs
+++ b/helix-tui/src/terminal.rs
@@ -14,9 +14,9 @@ pub enum CursorKind {
/// █
Block,
/// |
- // Bar,
+ Bar,
/// _
- // Underline,
+ Underline,
/// Hidden cursor, can set cursor position with this to let IME have correct cursor position.
Hidden,
}
@@ -70,7 +70,7 @@ where
fn drop(&mut self) {
// Attempt to restore the cursor state
if self.hidden_cursor {
- if let Err(err) = self.show_cursor() {
+ if let Err(err) = self.show_cursor(CursorKind::Block) {
eprintln!("Failed to show the cursor: {}", err);
}
}
@@ -184,8 +184,8 @@ where
}
match cursor_kind {
- CursorKind::Block => self.show_cursor()?,
CursorKind::Hidden => self.hide_cursor()?,
+ kind => self.show_cursor(kind)?,
}
// Swap buffers
@@ -203,8 +203,8 @@ where
Ok(())
}
- pub fn show_cursor(&mut self) -> io::Result<()> {
- self.backend.show_cursor()?;
+ pub fn show_cursor(&mut self, kind: CursorKind) -> io::Result<()> {
+ self.backend.show_cursor(kind)?;
self.hidden_cursor = false;
Ok(())
}