File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -2214,10 +2214,7 @@ struct Row10;"#};
2214
2214
let snapshot = editor. snapshot ( cx) ;
2215
2215
let all_hunks = editor_hunks ( editor, & snapshot, cx) ;
2216
2216
let all_expanded_hunks = expanded_hunks ( editor, & snapshot, cx) ;
2217
- assert_eq ! (
2218
- expanded_hunks_background_highlights( editor, cx) ,
2219
- vec![ DisplayRow ( 5 ) ..=DisplayRow ( 5 ) ]
2220
- ) ;
2217
+ assert_eq ! ( expanded_hunks_background_highlights( editor, cx) , Vec :: new( ) ) ;
2221
2218
assert_eq ! (
2222
2219
all_hunks,
2223
2220
vec![ (
Original file line number Diff line number Diff line change @@ -1335,7 +1335,11 @@ impl EditorElement {
1335
1335
}
1336
1336
match status {
1337
1337
DiffHunkStatus :: Added => { }
1338
- DiffHunkStatus :: Modified => { }
1338
+ DiffHunkStatus :: Modified => {
1339
+ if is_expanded {
1340
+ * status = DiffHunkStatus :: Added ;
1341
+ }
1342
+ }
1339
1343
DiffHunkStatus :: Removed => {
1340
1344
if is_expanded {
1341
1345
return None ;
Original file line number Diff line number Diff line change @@ -279,8 +279,12 @@ impl Editor {
279
279
..Point :: new ( remaining_hunk. row_range . end . 0 , 0 ) ;
280
280
hunks_to_expand. push ( HoveredHunk {
281
281
status : hunk_status ( & remaining_hunk) ,
282
- multi_buffer_range : remaining_hunk_point_range
283
- . to_anchors ( & snapshot. buffer_snapshot ) ,
282
+ multi_buffer_range : snapshot
283
+ . buffer_snapshot
284
+ . anchor_before ( remaining_hunk_point_range. start )
285
+ ..snapshot
286
+ . buffer_snapshot
287
+ . anchor_after ( remaining_hunk_point_range. end ) ,
284
288
diff_base_byte_range : remaining_hunk. diff_base_byte_range . clone ( ) ,
285
289
} ) ;
286
290
}
You can’t perform that action at this time.
0 commit comments