summaryrefslogtreecommitdiff
path: root/helix-view/src/document.rs
diff options
context:
space:
mode:
authorIvan Tham2021-12-02 04:46:57 +0000
committerGitHub2021-12-02 04:46:57 +0000
commite2b428cc2d23965ab7a91809c5705ede0298107d (patch)
tree35484052f5c54deba2ee9e842f693043452bc38f /helix-view/src/document.rs
parent418b833d2b64ed986cfc84ca023e1a6ca5080008 (diff)
Add last modified file (gm) (#1093)
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 76b19a07..2cb33fe3 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -104,6 +104,7 @@ pub struct Document {
last_saved_revision: usize,
version: i32, // should be usize?
+ pub(crate) modified_since_accessed: bool,
diagnostics: Vec<Diagnostic>,
language_server: Option<Arc<helix_lsp::Client>>,
@@ -127,6 +128,7 @@ impl fmt::Debug for Document {
// .field("history", &self.history)
.field("last_saved_revision", &self.last_saved_revision)
.field("version", &self.version)
+ .field("modified_since_accessed", &self.modified_since_accessed)
.field("diagnostics", &self.diagnostics)
// .field("language_server", &self.language_server)
.finish()
@@ -344,6 +346,7 @@ impl Document {
history: Cell::new(History::default()),
savepoint: None,
last_saved_revision: 0,
+ modified_since_accessed: false,
language_server: None,
}
}
@@ -639,6 +642,9 @@ impl Document {
selection.clone().ensure_invariants(self.text.slice(..)),
);
}
+
+ // set modified since accessed
+ self.modified_since_accessed = true;
}
if !transaction.changes().is_empty() {