Skip to content

Commit

Permalink
update releases.md
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Sep 25, 2024
1 parent 614dacf commit f3d6e00
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ language: 'en'

## Unreleased

- Fix background color for underline and beam cursors when using transparent window.
- Fix IME color for underline and beam cursors.
- Add default for Style property on Sugarloaf font.
<!-- - Fix: MacOS Delete key doesn't work in kitty mode [#513](https://github.com/raphamorim/rio/issues/513). -->
<!-- - Fix: Kitty keyboard protocol doesn't work with tmux [#599](https://github.com/raphamorim/rio/issues/599). -->

Expand Down
29 changes: 25 additions & 4 deletions frontends/rioterm/src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,36 @@ impl Renderer {
std::mem::swap(&mut background_color, &mut color);
}

// If IME is enabled or is a block cursor, put background color
let has_dynamic_background = self.dynamic_background.2
&& background_color[0] == self.dynamic_background.0[0]
&& background_color[1] == self.dynamic_background.0[1]
&& background_color[2] == self.dynamic_background.0[2];
let background_color = if has_dynamic_background
&& self.cursor.state.content != CursorShape::Block
{
None
} else {
Some(background_color)
};

// If IME is or cursor is block enabled, put background color
// when cursor is over the character
if self.is_ime_enabled || self.cursor.state.content == CursorShape::Block {
color = self.named_colors.background.0;
match (
self.is_ime_enabled,
self.cursor.state.content == CursorShape::Block,
) {
(_, true) => {
color = self.named_colors.background.0;
}
(true, false) => {
color = self.named_colors.foreground;
}
(false, false) => {}
}

let mut style = FragmentStyle {
color,
background_color: Some(background_color),
background_color,
font_attrs: font_attrs.into(),
..FragmentStyle::default()
};
Expand Down

0 comments on commit f3d6e00

Please sign in to comment.