Switch back to
This commit is contained in:
parent
687ccd4c6f
commit
cfdf9198da
3 changed files with 4 additions and 4 deletions
|
@ -66,7 +66,7 @@
|
||||||
// "always"
|
// "always"
|
||||||
// 4. Never show the scrollbar:
|
// 4. Never show the scrollbar:
|
||||||
// "never"
|
// "never"
|
||||||
"when_to_show": "auto",
|
"show": "auto",
|
||||||
// Whether to show git diff indicators in the scrollbar.
|
// Whether to show git diff indicators in the scrollbar.
|
||||||
"git_diff": true
|
"git_diff": true
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub struct EditorSettings {
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
|
||||||
pub struct Scrollbar {
|
pub struct Scrollbar {
|
||||||
pub when_to_show: ShowScrollbar,
|
pub show: ShowScrollbar,
|
||||||
pub git_diff: bool,
|
pub git_diff: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ pub struct EditorSettingsContent {
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
|
||||||
pub struct ScrollbarContent {
|
pub struct ScrollbarContent {
|
||||||
pub when_to_show: Option<ShowScrollbar>,
|
pub show: Option<ShowScrollbar>,
|
||||||
pub git_diff: Option<bool>,
|
pub git_diff: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2068,7 +2068,7 @@ impl Element<Editor> for EditorElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
let scrollbar_settings = &settings::get::<EditorSettings>(cx).scrollbar;
|
let scrollbar_settings = &settings::get::<EditorSettings>(cx).scrollbar;
|
||||||
let show_scrollbars = match scrollbar_settings.when_to_show {
|
let show_scrollbars = match scrollbar_settings.show {
|
||||||
ShowScrollbar::Auto => {
|
ShowScrollbar::Auto => {
|
||||||
// Git
|
// Git
|
||||||
(is_singleton && scrollbar_settings.git_diff && snapshot.buffer_snapshot.has_git_diffs())
|
(is_singleton && scrollbar_settings.git_diff && snapshot.buffer_snapshot.has_git_diffs())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue