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:
Cole Miller
2025-03-06 23:06:03 +00:00
committed by GitHub
parent efaf358876
commit a88af7351a
3 changed files with 17 additions and 1 deletions
+5
View File
@@ -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)]