Skip to content

Commit 440900d

Browse files
committed
improve the highlighting on the selected row
1 parent 5d8e7bd commit 440900d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: crates/atuin/src/command/client/search/history_list.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ impl DrawState<'_> {
221221

222222
fn command(&mut self, h: &History) {
223223
let mut style = self.theme.as_style(Meaning::Base);
224+
let mut row_highlighted = false;
224225
if !self.alternate_highlight && (self.y as usize + self.state.offset == self.state.selected)
225226
{
227+
row_highlighted = true;
226228
// if not applying alternative highlighting to the whole row, color the command
227229
style = self.theme.as_style(Meaning::AlertError);
228230
style.attributes.set(style::Attribute::Bold);
@@ -247,7 +249,12 @@ impl DrawState<'_> {
247249
}
248250
let mut style = style;
249251
if highlight_indices.contains(&pos) {
250-
style.attributes.toggle(style::Attribute::Bold);
252+
style.attributes.set(style::Attribute::Bold);
253+
if row_highlighted {
254+
// if the row is highlighted bold is not enough as the whole row is bold
255+
// change the color too
256+
style = self.theme.as_style(Meaning::AlertWarn)
257+
}
251258
}
252259
self.draw(&ch.to_string(), style.into());
253260
pos += 1;

0 commit comments

Comments
 (0)