Compare commits

..

1 Commits

2 changed files with 4 additions and 6 deletions

View File

@ -831,6 +831,8 @@ impl eframe::App for App {
} else { } else {
symbol_diff_ui(ui, diff_state, appearance) symbol_diff_ui(ui, diff_state, appearance)
}; };
// Clear the autoscroll flag so it doesn't scroll continuously.
diff_state.symbol_state.autoscroll_to_highlighted_symbols = false;
}); });
project_window(ctx, state, show_project_config, config_state, appearance); project_window(ctx, state, show_project_config, config_state, appearance);

View File

@ -199,9 +199,6 @@ impl DiffViewState {
ctx.output_mut(|o| o.open_url = Some(OpenUrl::new_tab(result.scratch_url))); ctx.output_mut(|o| o.open_url = Some(OpenUrl::new_tab(result.scratch_url)));
} }
// Clear the autoscroll flag so that it doesn't scroll continuously.
self.symbol_state.autoscroll_to_highlighted_symbols = false;
let Some(action) = action else { let Some(action) = action else {
return; return;
}; };
@ -543,9 +540,8 @@ fn symbol_ui(
// Automatically scroll the view to encompass the selected symbol in case the user selected // Automatically scroll the view to encompass the selected symbol in case the user selected
// an offscreen symbol by using a keyboard shortcut. // an offscreen symbol by using a keyboard shortcut.
ui.scroll_to_rect_animation(response.rect, None, ScrollAnimation::none()); ui.scroll_to_rect_animation(response.rect, None, ScrollAnimation::none());
// This autoscroll state flag will be reset in DiffViewState::post_update at the end of // This state flag will be reset in App::update at the end of every frame so that we don't
// every frame so that we don't continuously scroll the view back when the user is trying to // continuously scroll the view back when the user is trying to manually scroll away.
// manually scroll away.
} }
if response.clicked() || (selected && hotkeys::enter_pressed(ui.ctx())) { if response.clicked() || (selected && hotkeys::enter_pressed(ui.ctx())) {
if let Some(section) = section { if let Some(section) = section {