feat(ui): add show_cursor_outside_insert setting and Unicode‑aware wrapping; introduce grayscale‑high‑contrast theme

- Added `show_cursor_outside_insert` (default false) to `UiSettings` and synced it from config.
- Cursor rendering now follows `cursor_should_be_visible`, allowing visibility outside insert mode based on the new setting.
- Replaced `textwrap::wrap` with `wrap_unicode`, which uses Unicode break properties for proper CJK and emoji handling.
- Added `grayscale-high-contrast.toml` theme, registered it in theme loading, and updated README and tests.
This commit is contained in:
2025-10-12 15:47:22 +02:00
parent 0bd560b408
commit ae9c3af096
6 changed files with 182 additions and 40 deletions

View File

@@ -710,6 +710,8 @@ pub struct UiSettings {
pub input_max_rows: u16,
#[serde(default = "UiSettings::default_scrollback_lines")]
pub scrollback_lines: usize,
#[serde(default = "UiSettings::default_show_cursor_outside_insert")]
pub show_cursor_outside_insert: bool,
}
impl UiSettings {
@@ -744,6 +746,10 @@ impl UiSettings {
const fn default_scrollback_lines() -> usize {
2000
}
const fn default_show_cursor_outside_insert() -> bool {
false
}
}
impl Default for UiSettings {
@@ -757,6 +763,7 @@ impl Default for UiSettings {
show_onboarding: Self::default_show_onboarding(),
input_max_rows: Self::default_input_max_rows(),
scrollback_lines: Self::default_scrollback_lines(),
show_cursor_outside_insert: Self::default_show_cursor_outside_insert(),
}
}
}