diff options
author | Jakub Bartodziej | 2021-06-03 12:51:13 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-03 14:23:23 +0000 |
commit | 6cbc0aea926248f029ab3868d5ed9b8d5a4f207f (patch) | |
tree | 6e6cdc66786370fda46aaec590cc3ee79c71bbb6 /helix-view/src | |
parent | c1c3750d3801558bb9e6722e67d724b480a4cffa (diff) |
Disable deleting from an empty buffer which can cause a crash.
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/document.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 3a3b9390..c41b78ad 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -494,6 +494,10 @@ impl Document { pub fn versioned_identifier(&self) -> lsp::VersionedTextDocumentIdentifier { lsp::VersionedTextDocumentIdentifier::new(self.url().unwrap(), self.version) } + + pub fn empty(&self) -> bool { + self.text == "\n" + } } #[cfg(test)] |