@@ -3,9 +3,10 @@ use crate::{
3 buffer::Cell,
3 buffer::Cell,
4 layout::Rect,
4 layout::Rect,
5 style::{Color, Modifier},
5 style::{Color, Modifier},
7use crossterm::{
8use crossterm::{
8− cursor::{Hide, MoveTo, Show},
9+ cursor::{CursorShape, Hide, MoveTo, SetCursorShape, Show},
9 execute, queue,
10 execute, queue,
11 Attribute as CAttribute, Color as CColor, Print, SetAttribute, SetBackgroundColor,
12 Attribute as CAttribute, Color as CColor, Print, SetAttribute, SetBackgroundColor,
@@ -93,8 +94,14 @@ where
93 map_error(execute!(self.buffer, Hide))
94 map_error(execute!(self.buffer, Hide))
96− fn show_cursor(&mut self) -> io::Result<()> {
97+ fn show_cursor(&mut self, kind: CursorKind) -> io::Result<()> {
98+ let shape = match kind {
99+ CursorKind::Block => CursorShape::Block,
100+ CursorKind::Bar => CursorShape::Line,
101+ CursorKind::Underline => CursorShape::UnderScore,
102+ CursorKind::Hidden => unreachable!(),
97− map_error(execute!(self.buffer, Show))
104+ map_error(execute!(self.buffer, Show, SetCursorShape(shape)))
100 fn get_cursor(&mut self) -> io::Result<(u16, u16)> {
107 fn get_cursor(&mut self) -> io::Result<(u16, u16)> {