From 2dac219225a9448ec20f479fa8488232e36586cc Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 23 Jul 2026 23:07:47 +0200 Subject: fix: refresh-after-edit keeps the edited line on screen (rename now visible) On a large binary the renamed label appeared not to update: the edit refresh reloaded the listing from a nav entry whose cursor/scroll could be stale, so on a huge segment the rebuilt model primed/scrolled to the wrong index and the renamed line landed off-screen (or in an unloaded region) -- looking like the rename never propagated. (Small binaries hid it because everything is near the top.) _reload_active_code now captures the LIVE listing position straight from the widget (the source of truth) instead of trusting nav-entry tracking, so the rebuilt model primes around the real cursor and the edited line stays put. Verified: with _cur.cursor deliberately corrupted to 0, renaming a label at row 56 keeps it on screen (0000210E DEEPLBL:); decomp->Tab->rename and pure-listing rename still stay on the label. rename/rename_history/comment/retype/view_toggle/ decomp_nav/decomp_follow_self/follow_xrefs/xref_labels/disasm_nav/search/mouse/ listing_view/continuous_view/func_banners/scroll_restore 70/0. --- idatui/app.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/idatui/app.py b/idatui/app.py index c4cae93..823b024 100644 --- a/idatui/app.py +++ b/idatui/app.py @@ -3112,8 +3112,19 @@ class IdaTui(App): self.query_one(DecompView).loaded_ea = None # force re-decompile self._show_active() else: - self._save_current_pos() - cur.view = "listing" # we're in the listing; keep the entry consistent + # Capture the LIVE listing position straight from the widget (the + # source of truth) rather than trusting nav-entry tracking, which can + # go stale. bump_names() discards the segment model, so the reload + # rebuilds it; feeding the true cursor/scroll keeps the edited line on + # screen even on a huge segment (otherwise it primes/scrolls to a + # stale index and the renamed line lands off-screen — looking like the + # rename never applied). + lst = self.query_one(ListingView) + cur.view = "listing" + if lst.model is not None: + cur.cursor = lst.cursor + cur.cursor_x = lst.cursor_x + cur.scroll_y = round(lst.scroll_offset.y) self._open_entry(cur, push=False) def _after_comment(self, ea: int, text: str) -> None: -- cgit v1.3.1-sl0p