mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
SyntaxMap - Don't ignore deletions at the boundaries of layers
This commit is contained in:
parent
3612c46d6d
commit
ee66adbb49
@ -453,10 +453,9 @@ impl SyntaxSnapshot {
|
||||
Some(old_layer.tree.clone()),
|
||||
);
|
||||
changed_ranges = join_ranges(
|
||||
edits
|
||||
.iter()
|
||||
.map(|e| e.new.clone())
|
||||
.filter(|range| range.start < step_end_byte && range.end > step_start_byte),
|
||||
edits.iter().map(|e| e.new.clone()).filter(|range| {
|
||||
range.start <= step_end_byte && range.end >= step_start_byte
|
||||
}),
|
||||
old_layer
|
||||
.tree
|
||||
.changed_ranges(&tree)
|
||||
@ -1919,6 +1918,31 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
fn test_combined_injections_splitting_some_injections() {
|
||||
let (_buffer, _syntax_map) = test_edit_sequence(
|
||||
"ERB",
|
||||
&[
|
||||
r#"
|
||||
<%A if b(:c) %>
|
||||
d
|
||||
<% end %>
|
||||
eee
|
||||
<% f %>
|
||||
"#,
|
||||
r#"
|
||||
<%« AAAAAAA %>
|
||||
hhhhhhh
|
||||
<%=» if b(:c) %>
|
||||
d
|
||||
<% end %>
|
||||
eee
|
||||
<% f %>
|
||||
"#,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
#[gpui::test(iterations = 50)]
|
||||
fn test_random_syntax_map_edits(mut rng: StdRng) {
|
||||
let operations = env::var("OPERATIONS")
|
||||
|
Loading…
Reference in New Issue
Block a user