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.
This commit is contained in:
Michael Davis 2023-01-10 20:48:26 -06:00 committed by Blaž Hrastnik
parent a976786a4f
commit 79bf5e3094
5 changed files with 10 additions and 10 deletions

4
Cargo.lock generated
View File

@ -261,9 +261,9 @@ dependencies = [
[[package]] [[package]]
name = "crossterm" name = "crossterm"
version = "0.25.0" version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"crossterm_winapi", "crossterm_winapi",

View File

@ -37,7 +37,7 @@ which = "4.4"
tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] } tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] }
tui = { path = "../helix-tui", package = "helix-tui", default-features = false, features = ["crossterm"] } tui = { path = "../helix-tui", package = "helix-tui", default-features = false, features = ["crossterm"] }
crossterm = { version = "0.25", features = ["event-stream"] } crossterm = { version = "0.26", features = ["event-stream"] }
signal-hook = "0.3" signal-hook = "0.3"
tokio-stream = "0.1" tokio-stream = "0.1"
futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false } futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false }

View File

@ -19,7 +19,7 @@ default = ["crossterm"]
bitflags = "1.3" bitflags = "1.3"
cassowary = "0.3" cassowary = "0.3"
unicode-segmentation = "1.10" unicode-segmentation = "1.10"
crossterm = { version = "0.25", optional = true } crossterm = { version = "0.26", optional = true }
termini = "0.1" termini = "0.1"
serde = { version = "1", "optional" = true, features = ["derive"]} serde = { version = "1", "optional" = true, features = ["derive"]}
helix-view = { version = "0.6", path = "../helix-view", features = ["term"] } helix-view = { version = "0.6", path = "../helix-view", features = ["term"] }

View File

@ -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 @@ fn hide_cursor(&mut self) -> io::Result<()> {
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)> {

View File

@ -20,7 +20,7 @@ helix-core = { version = "0.6", path = "../helix-core" }
helix-loader = { version = "0.6", path = "../helix-loader" } helix-loader = { version = "0.6", path = "../helix-loader" }
helix-lsp = { version = "0.6", path = "../helix-lsp" } helix-lsp = { version = "0.6", path = "../helix-lsp" }
helix-dap = { version = "0.6", path = "../helix-dap" } helix-dap = { version = "0.6", path = "../helix-dap" }
crossterm = { version = "0.25", optional = true } crossterm = { version = "0.26", optional = true }
helix-vcs = { version = "0.6", path = "../helix-vcs" } helix-vcs = { version = "0.6", path = "../helix-vcs" }
# Conversion traits # Conversion traits