editor: Shrink DisplayMapSnapshot from 824 to 256 bytes (#39568)
We have unnecessary clones for the fields here as most of the snapshots contain the others hierarchically. Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -170,7 +170,8 @@ pub fn deploy_context_menu(
|
||||
};
|
||||
|
||||
let display_map = editor.selections.display_map(cx);
|
||||
let buffer = &editor.snapshot(window, cx).buffer_snapshot;
|
||||
let snapshot = editor.snapshot(window, cx);
|
||||
let buffer = snapshot.buffer_snapshot();
|
||||
let anchor = buffer.anchor_before(point.to_point(&display_map));
|
||||
if !display_ranges(&display_map, &editor.selections).any(|r| r.contains(&point)) {
|
||||
// Move the cursor to the clicked location so that dispatched actions make sense
|
||||
|
||||
Reference in New Issue
Block a user