Compare text length for plain text in the diffing.
This commit is contained in:
parent
11081f6936
commit
0fc3bb0245
@ -915,6 +915,18 @@ fn compare_plain_text<'s>(
|
|||||||
let mut this_status = DiffStatus::Good;
|
let mut this_status = DiffStatus::Good;
|
||||||
let mut message = None;
|
let mut message = None;
|
||||||
let text = emacs.as_text()?;
|
let text = emacs.as_text()?;
|
||||||
|
let emacs_text_length = {
|
||||||
|
let start_ind: usize = text.properties.get(0).expect("Should have start index.").as_atom()?.parse()?;
|
||||||
|
let end_ind: usize = text.properties.get(1).expect("Should have end index.").as_atom()?.parse()?;
|
||||||
|
end_ind - start_ind
|
||||||
|
};
|
||||||
|
if rust.source.len() != emacs_text_length {
|
||||||
|
this_status = DiffStatus::Bad;
|
||||||
|
message = Some(format!(
|
||||||
|
"(emacs len != rust len) {:?} != {:?}",
|
||||||
|
emacs_text_length, rust.source.len()
|
||||||
|
));
|
||||||
|
}
|
||||||
let unquoted_text = text.unquote()?;
|
let unquoted_text = text.unquote()?;
|
||||||
if unquoted_text != rust.source {
|
if unquoted_text != rust.source {
|
||||||
this_status = DiffStatus::Bad;
|
this_status = DiffStatus::Bad;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user