Disable nav history in vim scrolls (#32656)
Reland of #30345 to fix merge conflicts with the new skip-completions option Fixes #29431 Fixes #17592 Release Notes: - vim: Scrolls are no longer added to the jumplist
This commit is contained in:
parent
0fe35f440d
commit
9166e66519
7 changed files with 208 additions and 119 deletions
|
@ -1,12 +1,13 @@
|
|||
use crate::{
|
||||
DisplayRow, Editor, EditorMode, LineWithInvisibles, RowExt, display_map::ToDisplayPoint,
|
||||
DisplayRow, Editor, EditorMode, LineWithInvisibles, RowExt, SelectionEffects,
|
||||
display_map::ToDisplayPoint,
|
||||
};
|
||||
use gpui::{Bounds, Context, Pixels, Window, px};
|
||||
use language::Point;
|
||||
use multi_buffer::Anchor;
|
||||
use std::{cmp, f32};
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||
pub enum Autoscroll {
|
||||
Next,
|
||||
Strategy(AutoscrollStrategy, Option<Anchor>),
|
||||
|
@ -66,7 +67,16 @@ impl Autoscroll {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Default, Clone, Copy)]
|
||||
impl Into<SelectionEffects> for Option<Autoscroll> {
|
||||
fn into(self) -> SelectionEffects {
|
||||
match self {
|
||||
Some(autoscroll) => SelectionEffects::scroll(autoscroll),
|
||||
None => SelectionEffects::no_scroll(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Default, Clone, Copy)]
|
||||
pub enum AutoscrollStrategy {
|
||||
Fit,
|
||||
Newest,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue