update secondary selection head color

This commit is contained in:
alice pellerin
2026-04-11 18:58:27 -05:00
parent 383cc4ea8e
commit c65e2bf134
3 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ impl App {
fn tab_for(buffer: &Buffer, is_active: bool) -> Span<'static> {
let background = if is_active {
Color::select_grey()
Color::selection_tail_grey()
} else {
Color::ui_grey()
};
+6 -6
View File
@@ -260,15 +260,15 @@ use ratatui::{style::{Color, Style, Stylize}, text::Span};
match place_in_cursor {
InCursor::Head => span.bg(head_color),
InCursor::Rest => span.bg(Color::select_grey()),
InCursor::Rest => span.bg(Color::selection_tail_grey()),
}
} else {
match self.cursors
.iter()
.find_map(|cursor| cursor.contains(address))
{
Some(InCursor::Head) => span.on_gray(),
Some(InCursor::Rest) => span.bg(Color::select_grey()),
Some(InCursor::Head) => span.bg(Color::secondary_selection_head_grey()),
Some(InCursor::Rest) => span.bg(Color::selection_tail_grey()),
None => span,
}
}
@@ -286,7 +286,7 @@ use ratatui::{style::{Color, Style, Stylize}, text::Span};
.chain(&self.cursors)
.any(|cursor| cursor.contains_space_before(address))
{
span.bg(Color::select_grey())
span.bg(Color::selection_tail_grey())
} else {
span
}
@@ -303,7 +303,7 @@ use ratatui::{style::{Color, Style, Stylize}, text::Span};
.chain(&self.cursors)
.any(|cursor| cursor.contains_space_before(address))
{
span.bg(Color::select_grey())
span.bg(Color::selection_tail_grey())
} else {
span
}
@@ -392,7 +392,7 @@ mod character_panel {
.chain(&self.cursors)
.find_map(|cursor| cursor.contains(address))
{
Some(InCursor::Head) => span.bg(Color::select_grey()),
Some(InCursor::Head) => span.bg(Color::selection_tail_grey()),
Some(InCursor::Rest) => span.on_dark_gray(),
None => span,
}
+7 -2
View File
@@ -1,15 +1,20 @@
use ratatui::style::Color;
pub trait CustomGreys {
fn select_grey() -> Self;
fn selection_tail_grey() -> Self;
fn secondary_selection_head_grey() -> Self;
fn ui_grey() -> Self;
}
impl CustomGreys for Color {
fn select_grey() -> Self {
fn selection_tail_grey() -> Self {
Self::Indexed(242)
}
fn secondary_selection_head_grey() -> Self {
Self::Indexed(246)
}
fn ui_grey() -> Self {
Self::Indexed(238)
}