Skip to content

Commit

Permalink
Update crossterm to 0.26.1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
the-mikedavis authored and archseer committed Feb 28, 2023
1 parent a976786 commit 79bf5e3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion helix-term/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
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"
tokio-stream = "0.1"
futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion helix-tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
10 changes: 5 additions & 5 deletions helix-tui/src/backend/crossterm.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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)> {
Expand Down
2 changes: 1 addition & 1 deletion helix-view/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ helix-core = { version = "0.6", path = "../helix-core" }
helix-loader = { version = "0.6", path = "../helix-loader" }
helix-lsp = { version = "0.6", path = "../helix-lsp" }
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" }

# Conversion traits
Expand Down

0 comments on commit 79bf5e3

Please sign in to comment.