Introduce buffer::Content<'a> struct to share logic with buffer::Snapshot
We want to move a bunch of methods on FoldMap to fold_map::Snapshot. This captures a buffer snapshot, and we'll need a bunch of methods that currently are on Buffer to also be implemented on buffer::Snapshot. This Content reference struct will be a good zero-cost place to store that logic.
This commit is contained in:
+2
-2
@@ -1215,8 +1215,8 @@ impl Editor {
|
||||
String::from_iter(clipboard_chars.by_ref().take(clipboard_selection.len));
|
||||
|
||||
self.buffer.update(cx, |buffer, cx| {
|
||||
let selection_start = selection.start.to_point(buffer);
|
||||
let selection_end = selection.end.to_point(buffer);
|
||||
let selection_start = selection.start.to_point(&*buffer);
|
||||
let selection_end = selection.end.to_point(&*buffer);
|
||||
|
||||
// If the corresponding selection was empty when this slice of the
|
||||
// clipboard text was written, then the entire line containing the
|
||||
|
||||
Reference in New Issue
Block a user