repl: Make output buffer be readonly, never dirty (#17121)
This commit is contained in:
parent
6646b15f29
commit
02cd5128c7
5 changed files with 37 additions and 11 deletions
|
@ -1591,12 +1591,13 @@ impl Buffer {
|
|||
|
||||
/// Checks if the buffer has unsaved changes.
|
||||
pub fn is_dirty(&self) -> bool {
|
||||
self.has_conflict
|
||||
|| self.has_unsaved_edits()
|
||||
|| self
|
||||
.file
|
||||
.as_ref()
|
||||
.map_or(false, |file| file.is_deleted() || !file.is_created())
|
||||
self.capability != Capability::ReadOnly
|
||||
&& (self.has_conflict
|
||||
|| self.has_unsaved_edits()
|
||||
|| self
|
||||
.file
|
||||
.as_ref()
|
||||
.map_or(false, |file| file.is_deleted() || !file.is_created()))
|
||||
}
|
||||
|
||||
/// Checks if the buffer and its file have both changed since the buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue