Save text in document saved events, use in status message

pull/2267/head
Skyler Hawthorne 2 years ago
parent f82a551b98
commit 18c32118b1

@ -459,8 +459,8 @@ impl Application {
doc.set_last_saved_revision(doc_save_event.revision); doc.set_last_saved_revision(doc_save_event.revision);
let lines = doc.text().len_lines(); let lines = doc_save_event.text.len_lines();
let bytes = doc.text().len_bytes(); let bytes = doc_save_event.text.len_bytes();
if let Err(err) = doc.set_path(Some(&doc_save_event.path)) { if let Err(err) = doc.set_path(Some(&doc_save_event.path)) {
log::error!( log::error!(

@ -93,6 +93,7 @@ pub struct DocumentSavedEvent {
pub revision: usize, pub revision: usize,
pub doc_id: DocumentId, pub doc_id: DocumentId,
pub path: PathBuf, pub path: PathBuf,
pub text: Rope,
} }
pub type DocumentSavedEventResult = Result<DocumentSavedEvent, anyhow::Error>; pub type DocumentSavedEventResult = Result<DocumentSavedEvent, anyhow::Error>;
@ -620,6 +621,7 @@ impl Document {
revision: current_rev, revision: current_rev,
doc_id, doc_id,
path, path,
text: text.clone(),
}; };
if let Some(language_server) = language_server { if let Some(language_server) = language_server {

Loading…
Cancel
Save