Disable restore hunk control for created files (#25841)
Release Notes: - Git Beta: disable hunk restore action and button for created files
This commit is contained in:
parent
efaf358876
commit
a88af7351a
3 changed files with 17 additions and 1 deletions
|
@ -154,6 +154,11 @@ impl MultiBufferDiffHunk {
|
|||
secondary: self.secondary_status,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_created_file(&self) -> bool {
|
||||
self.diff_base_byte_range == (0..0)
|
||||
&& self.buffer_range == (text::Anchor::MIN..text::Anchor::MAX)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Ord, PartialOrd, Clone, Hash, Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue