git: Add hunk_style
setting (#26038)
This PR adds the `git.hunk_style` setting, allowing setting an alternate style for hunks – specifically the rendering of unstaged hunks. It has 2 options: - `transparent` (unstaged hunks are more transparent/less opaque than staged hunks) - `pattern (unstaged hunks are indicated by a visual pattern) We'll possibly explore a VSCode-style "don't show staged hunks", but the complexity it adds is a bit out of scope for now. Transparent:  Pattern:  Release Notes: - Git Beta: Added `git.hunk_style` setting to allow toggling between git hunk visual styles.
This commit is contained in:
parent
0ec15d6b02
commit
6cdd7b7390
4 changed files with 81 additions and 29 deletions
|
@ -168,6 +168,10 @@ pub struct GitSettings {
|
|||
///
|
||||
/// Default: on
|
||||
pub inline_blame: Option<InlineBlameSettings>,
|
||||
/// How hunks are displayed visually in the editor.
|
||||
///
|
||||
/// Default: transparent
|
||||
pub hunk_style: Option<GitHunkStyleSetting>,
|
||||
}
|
||||
|
||||
impl GitSettings {
|
||||
|
@ -200,6 +204,16 @@ impl GitSettings {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum GitHunkStyleSetting {
|
||||
/// Show unstaged hunks with a transparent background
|
||||
#[default]
|
||||
Transparent,
|
||||
/// Show unstaged hunks with a pattern background
|
||||
Pattern,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum GitGutterSetting {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue