Add scrollbars setting
This commit is contained in:
@@ -516,6 +516,15 @@ pub struct EditorSnapshot {
|
||||
ongoing_scroll: OngoingScroll,
|
||||
}
|
||||
|
||||
impl EditorSnapshot {
|
||||
fn has_scrollbar_info(&self) -> bool {
|
||||
self.buffer_snapshot
|
||||
.git_diff_hunks_in_range(0..self.max_point().row(), false)
|
||||
.next()
|
||||
.is_some()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct SelectionHistoryEntry {
|
||||
selections: Arc<[Selection<Anchor>]>,
|
||||
|
||||
@@ -2058,7 +2058,15 @@ impl Element<Editor> for EditorElement {
|
||||
));
|
||||
}
|
||||
|
||||
let show_scrollbars = editor.scroll_manager.scrollbars_visible();
|
||||
let show_scrollbars = match cx.global::<Settings>().show_scrollbars {
|
||||
settings::ShowScrollbars::Auto => {
|
||||
snapshot.has_scrollbar_info()
|
||||
|| editor.scroll_manager.scrollbars_visible()
|
||||
}
|
||||
settings::ShowScrollbars::System => editor.scroll_manager.scrollbars_visible(),
|
||||
settings::ShowScrollbars::Always => true,
|
||||
};
|
||||
|
||||
let include_root = editor
|
||||
.project
|
||||
.as_ref()
|
||||
|
||||
Reference in New Issue
Block a user