|
|
@ -1,6 +1,6 @@
|
|
|
|
use crate::{backend::Backend, buffer::Cell};
|
|
|
|
use crate::{backend::Backend, buffer::Cell};
|
|
|
|
use crossterm::{
|
|
|
|
use crossterm::{
|
|
|
|
cursor::{CursorShape, Hide, MoveTo, SetCursorShape, Show},
|
|
|
|
cursor::{Hide, MoveTo, SetCursorStyle, Show},
|
|
|
|
execute, queue,
|
|
|
|
execute, queue,
|
|
|
|
style::{
|
|
|
|
style::{
|
|
|
|
Attribute as CAttribute, Color as CColor, Print, SetAttribute, SetBackgroundColor,
|
|
|
|
Attribute as CAttribute, Color as CColor, Print, SetAttribute, SetBackgroundColor,
|
|
|
@ -156,12 +156,12 @@ where
|
|
|
|
|
|
|
|
|
|
|
|
fn show_cursor(&mut self, kind: CursorKind) -> io::Result<()> {
|
|
|
|
fn show_cursor(&mut self, kind: CursorKind) -> io::Result<()> {
|
|
|
|
let shape = match kind {
|
|
|
|
let shape = match kind {
|
|
|
|
CursorKind::Block => CursorShape::Block,
|
|
|
|
CursorKind::Block => SetCursorStyle::SteadyBlock,
|
|
|
|
CursorKind::Bar => CursorShape::Line,
|
|
|
|
CursorKind::Bar => SetCursorStyle::SteadyBar,
|
|
|
|
CursorKind::Underline => CursorShape::UnderScore,
|
|
|
|
CursorKind::Underline => SetCursorStyle::SteadyUnderScore,
|
|
|
|
CursorKind::Hidden => unreachable!(),
|
|
|
|
CursorKind::Hidden => unreachable!(),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
map_error(execute!(self.buffer, Show, SetCursorShape(shape)))
|
|
|
|
map_error(execute!(self.buffer, Show, shape))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn get_cursor(&mut self) -> io::Result<(u16, u16)> {
|
|
|
|
fn get_cursor(&mut self) -> io::Result<(u16, u16)> {
|
|
|
|