fix: coalesce rapid viewport scrolling redraws

This commit is contained in:
Valdemar Lorenzen
2026-10-16 10:15:24 +02:00
parent 08fdf2bd0f
commit 5a8c37b2f2
3 changed files with 90 additions and 0 deletions
+16
View File
@@ -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()