WIP: Re-implement apply_local_edit to look more like apply_remote_edit

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra
2021-06-03 19:32:54 +02:00
co-authored by Nathan Sobo Max Brunsfeld
parent 72464a9460
commit 9a29f55777
2 changed files with 138 additions and 208 deletions
+1 -3
View File
@@ -723,9 +723,7 @@ impl Editor {
let mut new_selections = Vec::new();
self.buffer.update(cx, |buffer, cx| {
let edit_ranges = old_selections.iter().map(|(_, range)| range.clone());
if let Err(error) = buffer.edit(edit_ranges, text.as_str(), Some(cx)) {
log::error!("error inserting text: {}", error);
};
buffer.edit(edit_ranges, text.as_str(), Some(cx));
let text_len = text.len() as isize;
let mut delta = 0_isize;
new_selections = old_selections