aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-24 00:38:58 +0200
committerblasty <blasty@local>2026-07-24 00:38:58 +0200
commit99d01ab72b92c5ef42784c742b1aa7d52a05a52d (patch)
treec259f8b29b5a8b57ea37e0e87c201326dae3a285
parentux: fix truncated loading-splash message (diff)
downloadida-tui-99d01ab72b92c5ef42784c742b1aa7d52a05a52d.tar.gz
ida-tui-99d01ab72b92c5ef42784c742b1aa7d52a05a52d.tar.xz
ida-tui-99d01ab72b92c5ef42784c742b1aa7d52a05a52d.zip
nav: baseline horizontal scroll at 0 when jumping to a target column
DecompView.goto (repositioning within an already-loaded function, e.g. an xref jump inside the current function) derived the horizontal scroll from the CURRENT offset and kept it when the target column fell inside the (stale) viewport. So a jump could land the cursor on the right column but leave the pane still scrolled right from wherever you were, showing the line shifted/off. Baseline the horizontal offset at 0 before computing: reset to 0, then scroll right only if the target column is beyond the viewport width. The derive branch is jump-only; back/forward restores pass an explicit scroll_x and are untouched. Verified: goto with a stale scroll_x=19 -> scroll_x=0 after (col fits); scroll_restore + decomp_nav/decomp_follow_self/follow_xrefs/xref_labels/ view_toggle/disasm_nav/search/mouse/listing_view/continuous_view/func_banners green.
-rw-r--r--idatui/app.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/idatui/app.py b/idatui/app.py
index d56205f..e54c418 100644
--- a/idatui/app.py
+++ b/idatui/app.py
@@ -1441,10 +1441,11 @@ class DecompView(SearchMixin, NavMixin, ColumnCursor, ScrollView, can_focus=True
else:
scroll_y = top
width = max(self.size.width - self._gutter, 1)
- sx = round(self.scroll_offset.x)
- if self.cursor_x < sx:
- scroll_x = self.cursor_x
- elif self.cursor_x >= sx + width:
+ # Always baseline the horizontal scroll at 0 for a jump, then scroll
+ # right only if the target column falls outside the viewport — never
+ # keep a stale horizontal offset from wherever we were before.
+ sx = 0
+ if self.cursor_x >= sx + width:
scroll_x = self.cursor_x - width + 1
else:
scroll_x = sx