Fix cursor adjustment on scroll

Fixes: zed-industries/community#1929

Also preserves visual modes correctly.
This commit is contained in:
Conrad Irwin 2023-08-18 10:38:06 -06:00
parent d1aa82bb48
commit e3c0e93e46
2 changed files with 20 additions and 23 deletions

View file

@ -29,6 +29,7 @@ use self::{
};
pub const SCROLL_EVENT_SEPARATION: Duration = Duration::from_millis(28);
pub const VERTICAL_SCROLL_MARGIN: f32 = 3.;
const SCROLLBAR_SHOW_INTERVAL: Duration = Duration::from_secs(1);
#[derive(Default)]
@ -136,7 +137,7 @@ pub struct ScrollManager {
impl ScrollManager {
pub fn new() -> Self {
ScrollManager {
vertical_scroll_margin: 3.0,
vertical_scroll_margin: VERTICAL_SCROLL_MARGIN,
anchor: ScrollAnchor::new(),
ongoing: OngoingScroll::new(),
autoscroll_request: None,