From 8860fabf196a5002601b731ec8dcea2d372c6e8f Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Fri, 2 Sep 2022 16:37:53 -0700 Subject: [PATCH] Fix novel_regions_after_unchanged to always append the last region This is the correct thing to do (and consistent with novel_regions_before_unchanged), although I haven't found any examples where it affects the results. --- src/diff/sliders.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/diff/sliders.rs b/src/diff/sliders.rs index 1a4278099..5acace3e5 100644 --- a/src/diff/sliders.rs +++ b/src/diff/sliders.rs @@ -396,6 +396,10 @@ fn novel_regions_before_unchanged<'a>( } } + if let Some(region) = region { + regions.push(region); + } + regions .into_iter() .filter(|r| !r.is_empty())