Skip to content

Commit 1121723

Browse files
authored
fix: Fix a logic error in suffix calculation for text changes (#423)
1 parent 590aada commit 1121723

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platforms/atspi-common/src/adapter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ impl<'a> AdapterChangeHandler<'a> {
104104
}
105105
}
106106

107-
let suffix_byte_count = old_text
107+
let suffix_byte_count = old_text[prefix_byte_count..]
108108
.chars()
109109
.rev()
110-
.zip(new_text.chars().rev())
110+
.zip(new_text[prefix_byte_count..].chars().rev())
111111
.take_while(|(old_char, new_char)| old_char == new_char)
112112
.fold(0, |count, (c, _)| count + c.len_utf8());
113113

0 commit comments

Comments
 (0)