MCPcopy Index your code
hub / github.com/encounter/objdiff / post_update

Method post_update

objdiff-gui/src/views/symbol_diff.rs:193–373  ·  view source on GitHub ↗
(
        &mut self,
        action: Option<DiffViewAction>,
        ctx: &egui::Context,
        jobs: &mut JobQueue,
        state: &AppStateRef,
    )

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 14

resolve_navigationFunction · 0.85
is_someMethod · 0.80
resolve_symbolMethod · 0.80
is_noneMethod · 0.80
is_selecting_symbolMethod · 0.80
clear_selectionMethod · 0.80
set_selecting_rightMethod · 0.80
set_selecting_leftMethod · 0.80
set_current_searchMethod · 0.80
set_highlightMethod · 0.80
clear_highlightMethod · 0.80
set_symbol_mappingMethod · 0.80

Tested by

no test coverage detected