editor: Keep scrollbar up if there are selections (#2698)

Z-2556

/cc @JosephTLyons 

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2023-07-11 09:32:34 +02:00 committed by GitHub
commit 4125e7eccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2149,6 +2149,9 @@ impl Element<Editor> for EditorElement {
ShowScrollbar::Auto => {
// Git
(is_singleton && scrollbar_settings.git_diff && snapshot.buffer_snapshot.has_git_diffs())
||
// Selections
(is_singleton && scrollbar_settings.selections && !highlighted_ranges.is_empty())
// Scrollmanager
|| editor.scroll_manager.scrollbars_visible()
}