Skip to content

Commit 0e47cf3

Browse files
committed
Update laurier
1 parent 4034597 commit 0e47cf3

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ image = { version = "0.25.8", default-features = false, features = [
2626
"rayon",
2727
"png",
2828
] }
29-
laurier = "0.1.1"
29+
laurier = "0.2.0"
3030
once_cell = "1.21.3"
3131
ratatui = { version = "0.29.0", features = ["serde"] }
3232
rayon = "1.11.0"

src/widget/commit_list.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ impl CommitList<'_> {
806806
let sub_spans =
807807
if let Some(pos) = state.search_matches[state.offset + i].subject.clone() {
808808
highlighted_spans(
809-
subject,
809+
subject.into(),
810810
pos,
811811
self.color_theme.list_subject_fg,
812812
Modifier::empty(),
@@ -842,7 +842,7 @@ impl CommitList<'_> {
842842
let spans =
843843
if let Some(pos) = state.search_matches[state.offset + i].author_name.clone() {
844844
highlighted_spans(
845-
name,
845+
name.into(),
846846
pos,
847847
self.color_theme.list_name_fg,
848848
Modifier::empty(),
@@ -869,7 +869,7 @@ impl CommitList<'_> {
869869
let spans =
870870
if let Some(pos) = state.search_matches[state.offset + i].commit_hash.clone() {
871871
highlighted_spans(
872-
hash,
872+
hash.into(),
873873
pos,
874874
self.color_theme.list_hash_fg,
875875
Modifier::empty(),
@@ -983,7 +983,7 @@ fn refs_spans<'a>(
983983
.get(name)
984984
.map(|pos| {
985985
highlighted_spans(
986-
name.to_string(),
986+
name.into(),
987987
pos.clone(),
988988
fg,
989989
Modifier::BOLD,
@@ -1030,14 +1030,14 @@ fn refs_spans<'a>(
10301030
}
10311031

10321032
fn highlighted_spans(
1033-
s: String,
1033+
s: Span<'_>,
10341034
pos: SearchMatchPosition,
10351035
base_fg: Color,
10361036
base_modifier: Modifier,
10371037
color_theme: &ColorTheme,
10381038
truncate: bool,
10391039
) -> Vec<Span<'static>> {
1040-
let mut hm = highlight_matched_text(s)
1040+
let mut hm = highlight_matched_text(vec![s])
10411041
.matched_indices(pos.matched_indices)
10421042
.not_matched_style(Style::default().fg(base_fg).add_modifier(base_modifier))
10431043
.matched_style(

0 commit comments

Comments
 (0)