Skip to content

Commit

Permalink
Use a crossterm patch with unreleased changes
Browse files Browse the repository at this point in the history
This patch of crossterm contains two yet-unreleased changes:

* Support for the "report alternate keys" part of the Kitty Keyboard
  Protocol. This part of the protocol lets us bind symbols in keymaps
  instead of key-presses. For example,  A-_  would be  A-S-minus
  without "report alternate keys" being enabled. Kakoune is another
  example consumer that uses this feature.
* A fix for the function that checks for Kitty Keyboard Protocol
  support. The latest release has a bug that forces the function to
  always detect no support.
  • Loading branch information
the-mikedavis committed Feb 11, 2023
1 parent 3b301a9 commit 37996eb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
5 changes: 2 additions & 3 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ inherits = "test"
package.helix-core.opt-level = 2
package.helix-tui.opt-level = 2
package.helix-term.opt-level = 2

[patch.crates-io]
crossterm = { git = "https://github.com/crossterm-rs/crossterm", rev = "bca71adad70c36de3a4e13d7edc31c0ef9567f47" }
2 changes: 1 addition & 1 deletion helix-term/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,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 37996eb

Please sign in to comment.