Skip to content

Commit

Permalink
Add inline input method support
Browse files Browse the repository at this point in the history
This commit adds support for inline IME handling. It also makes search
bar draw proper Underline cursor instead of using '_' character.

Fixes #1613.
  • Loading branch information
kchibisov committed Mar 19, 2022
1 parent f4bdf5f commit 49bfc78
Show file tree
Hide file tree
Showing 8 changed files with 287 additions and 48 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Support for OpenGL ES 2.0
- Escape sequence to set underline color (`CSI 58 : 2 : Ps : Ps : Ps m`/`CSI 58 : 5 : Ps m`)
- Escape sequence to reset underline color (`CSI 59 m`)
- Support for inline input method

### Changed

- The `--help` output was reworked with a new colorful syntax
- Search bar is now respecting cursor thickness

### Fixed

Expand Down
25 changes: 17 additions & 8 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 @@ -9,3 +9,6 @@ members = [
lto = true
debug = 1
incremental = false

[patch.crates-io]
winit = { git = "https://github.com/rust-windowing/winit", branch = "composition-event" }
5 changes: 5 additions & 0 deletions alacritty/src/display/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl<'a> RenderableContent<'a> {
// Find terminal cursor shape.
let cursor_shape = if terminal_content.cursor.shape == CursorShape::Hidden
|| display.cursor_hidden
|| display.handling_ime()
|| search_state.regex().is_some()
{
CursorShape::Hidden
Expand Down Expand Up @@ -386,6 +387,10 @@ impl RenderableCursor {
}

impl RenderableCursor {
pub fn new(point: Point<usize>, shape: CursorShape, cursor_color: Rgb, is_wide: bool) -> Self {
Self { point, shape, cursor_color, text_color: cursor_color, is_wide }
}

pub fn color(&self) -> Rgb {
self.cursor_color
}
Expand Down

0 comments on commit 49bfc78

Please sign in to comment.