(
&mut self,
action: Option<DiffViewAction>,
ctx: &egui::Context,
jobs: &mut JobQueue,
state: &AppStateRef,
)
| 191 | } |
| 192 | |
| 193 | pub fn post_update( |
| 194 | &mut self, |
| 195 | action: Option<DiffViewAction>, |
| 196 | ctx: &egui::Context, |
| 197 | jobs: &mut JobQueue, |
| 198 | state: &AppStateRef, |
| 199 | ) { |
| 200 | if let Some(result) = take(&mut self.scratch) { |
| 201 | ctx.open_url(OpenUrl::new_tab(result.scratch_url)); |
| 202 | } |
| 203 | |
| 204 | // Clear the scroll flags to prevent it from scrolling continuously. |
| 205 | self.symbol_state.autoscroll_to_highlighted_symbols = false; |
| 206 | self.scroll_to_diff_row = None; |
| 207 | |
| 208 | let Some(action) = action else { |
| 209 | return; |
| 210 | }; |
| 211 | match action { |
| 212 | DiffViewAction::Build => { |
| 213 | if let Ok(mut state) = state.write() { |
| 214 | state.queue_build = true; |
| 215 | } |
| 216 | } |
| 217 | DiffViewAction::Navigate(nav) => { |
| 218 | if self.post_build_nav.is_some() { |
| 219 | // Ignore action if we're already navigating |
| 220 | return; |
| 221 | } |
| 222 | let Ok(mut state) = state.write() else { |
| 223 | return; |
| 224 | }; |
| 225 | |
| 226 | let mut resolved_left = self.resolve_symbol(nav.left_symbol, 0); |
| 227 | let mut resolved_right = self.resolve_symbol(nav.right_symbol, 1); |
| 228 | if let Some(resolved_right) = &resolved_right |
| 229 | && resolved_left.is_none() |
| 230 | { |
| 231 | resolved_left = resolved_right |
| 232 | .target_symbol |
| 233 | .and_then(|idx| self.resolve_symbol(Some(idx), 0)); |
| 234 | } |
| 235 | if let Some(resolved_left) = &resolved_left |
| 236 | && resolved_right.is_none() |
| 237 | { |
| 238 | resolved_right = resolved_left |
| 239 | .target_symbol |
| 240 | .and_then(|idx| self.resolve_symbol(Some(idx), 1)); |
| 241 | } |
| 242 | let resolved_nav = resolve_navigation(nav.kind, resolved_left, resolved_right); |
| 243 | if (resolved_nav.left_symbol.is_some() && resolved_nav.right_symbol.is_some()) |
| 244 | || (resolved_nav.left_symbol.is_none() && resolved_nav.right_symbol.is_none()) |
| 245 | { |
| 246 | // Regular navigation |
| 247 | if state.is_selecting_symbol() { |
| 248 | // Cancel selection and reload |
| 249 | state.clear_selection(); |
| 250 | self.post_build_nav = Some(resolved_nav); |
nothing calls this directly
no test coverage detected