From 79bf5e3094e16a34637703b14c7bf090d2dcf155 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 10 Jan 2023 20:48:26 -0600 Subject: Update crossterm to 0.26.1 Crossterm 0.26.x includes a breaking change for the command to set the cursor shape. This commit includes a change which uses the new type. --- helix-tui/Cargo.toml | 2 +- helix-tui/src/backend/crossterm.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'helix-tui') diff --git a/helix-tui/Cargo.toml b/helix-tui/Cargo.toml index a4a1c389..ccd016f5 100644 --- a/helix-tui/Cargo.toml +++ b/helix-tui/Cargo.toml @@ -19,7 +19,7 @@ default = ["crossterm"] bitflags = "1.3" cassowary = "0.3" unicode-segmentation = "1.10" -crossterm = { version = "0.25", optional = true } +crossterm = { version = "0.26", optional = true } termini = "0.1" serde = { version = "1", "optional" = true, features = ["derive"]} helix-view = { version = "0.6", path = "../helix-view", features = ["term"] } diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs index c00e1f40..5305640c 100644 --- a/helix-tui/src/backend/crossterm.rs +++ b/helix-tui/src/backend/crossterm.rs @@ -1,6 +1,6 @@ use crate::{backend::Backend, buffer::Cell}; use crossterm::{ - cursor::{CursorShape, Hide, MoveTo, SetCursorShape, Show}, + cursor::{Hide, MoveTo, SetCursorStyle, Show}, execute, queue, style::{ Attribute as CAttribute, Color as CColor, Print, SetAttribute, SetBackgroundColor, @@ -156,12 +156,12 @@ where fn show_cursor(&mut self, kind: CursorKind) -> io::Result<()> { let shape = match kind { - CursorKind::Block => CursorShape::Block, - CursorKind::Bar => CursorShape::Line, - CursorKind::Underline => CursorShape::UnderScore, + CursorKind::Block => SetCursorStyle::SteadyBlock, + CursorKind::Bar => SetCursorStyle::SteadyBar, + CursorKind::Underline => SetCursorStyle::SteadyUnderScore, 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)> { -- cgit v1.2.3-70-g09d2