aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/document.rs17
-rw-r--r--helix-view/src/editor.rs8
2 files changed, 21 insertions, 4 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index b6e42065..1743fac2 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -551,6 +551,11 @@ impl Document {
bail!("saves are closed for this document!");
}
+ log::debug!(
+ "submitting save of doc '{:?}'",
+ self.path().map(|path| path.to_string_lossy())
+ );
+
// we clone and move text + path into the future so that we asynchronously save the current
// state without blocking any further edits.
let mut text = self.text().clone();
@@ -695,7 +700,14 @@ impl Document {
self.set_last_saved_revision(event.revision);
false
}
- Err(_) => true,
+ Err(err) => {
+ log::error!(
+ "error saving document {:?}: {}",
+ self.path().map(|path| path.to_string_lossy()),
+ err
+ );
+ true
+ }
};
final_result = Some(save_event);
@@ -1072,7 +1084,8 @@ impl Document {
let current_revision = history.current_revision();
self.history.set(history);
log::debug!(
- "modified - last saved: {}, current: {}",
+ "id {} modified - last saved: {}, current: {}",
+ self.id,
self.last_saved_revision,
current_revision
);
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index e54aa7fa..58fcf238 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -816,12 +816,16 @@ impl Editor {
#[inline]
pub fn set_status<T: Into<Cow<'static, str>>>(&mut self, status: T) {
- self.status_msg = Some((status.into(), Severity::Info));
+ let status = status.into();
+ log::debug!("editor status: {}", status);
+ self.status_msg = Some((status, Severity::Info));
}
#[inline]
pub fn set_error<T: Into<Cow<'static, str>>>(&mut self, error: T) {
- self.status_msg = Some((error.into(), Severity::Error));
+ let error = error.into();
+ log::error!("editor error: {}", error);
+ self.status_msg = Some((error, Severity::Error));
}
#[inline]