Skip to content

Commit

Permalink
fix: Fix a logic error in suffix calculation for text changes (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwcampbell authored May 27, 2024
1 parent 590aada commit 1121723
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platforms/atspi-common/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ impl<'a> AdapterChangeHandler<'a> {
}
}

let suffix_byte_count = old_text
let suffix_byte_count = old_text[prefix_byte_count..]
.chars()
.rev()
.zip(new_text.chars().rev())
.zip(new_text[prefix_byte_count..].chars().rev())
.take_while(|(old_char, new_char)| old_char == new_char)
.fold(0, |count, (c, _)| count + c.len_utf8());

Expand Down

0 comments on commit 1121723

Please sign in to comment.