Skip to content

Commit

Permalink
fzf: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
noib3 committed Nov 12, 2023
1 parent 617342f commit 61bff9c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/algos/fzf/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ fn score_first_row(
let Some((byte_idx, matched_char)) = utils::find_first(
query_first_char,
candidate,
is_case_sensitive,
is_candidate_ascii,
is_case_sensitive,
char_eq,
) else {
for col in col..scores_first_row.len() {
Expand Down Expand Up @@ -502,8 +502,8 @@ fn score_remaining_rows(
let Some((byte_offset, matched_char)) = utils::find_first(
query_char,
candidate,
is_case_sensitive,
is_candidate_ascii,
is_case_sensitive,
char_eq,
) else {
for col in column..matrix_width {
Expand Down
14 changes: 14 additions & 0 deletions tests/fzf_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,17 @@ fn fzf_v2_score_2() {

assert!(mach.is_none());
}

#[test]
fn fzf_v2_score_3() {
let mut fzf = FzfV2::new()
.with_case_sensitivity(CaseSensitivity::Sensitive)
.with_matched_ranges(true);

let mut parser = FzfParser::new();

let mach =
fzf.distance(parser.parse("\0\0"), "\0#B\0\u{364}\0\0").unwrap();

assert_eq!(mach.matched_ranges().sorted(), [0..1, 3..4]);
}

0 comments on commit 61bff9c

Please sign in to comment.