fix: coalesce rapid viewport scrolling redraws
This commit is contained in:
@@ -4457,6 +4457,10 @@ impl Editor {
|
||||
| Action::Right
|
||||
| Action::Down
|
||||
| Action::Up
|
||||
| Action::ScrollUp
|
||||
| Action::ScrollDown
|
||||
| Action::ScrollHalfUp
|
||||
| Action::ScrollHalfDown
|
||||
| Action::LineStart
|
||||
| Action::LineEnd
|
||||
| Action::DocumentStart
|
||||
@@ -4472,6 +4476,18 @@ impl Editor {
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn viewport_scroll_action(&self, input: &Input) -> Option<&'static str> {
|
||||
match self.bindings.get(&self.active.view.mode)?.get(input)? {
|
||||
Binding::Action(
|
||||
action @ (Action::ScrollUp
|
||||
| Action::ScrollDown
|
||||
| Action::ScrollHalfUp
|
||||
| Action::ScrollHalfDown),
|
||||
) => Some(action.entry().name),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn diff_editable(&self) -> bool {
|
||||
self.diff().is_some_and(|diff| {
|
||||
self.diff_buffer_focus()
|
||||
|
||||
Reference in New Issue
Block a user