summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblasty <peter@haxx.in>2026-07-24 00:38:58 +0200
committerblasty <peter@haxx.in>2026-07-24 00:38:58 +0200
commit215a607dc0007c9a0eb8f629547372e0e2735c02 (patch)
tree9dc99d9c9b95cb908e5605b3bae4fa1517af599f
parentux: fix truncated loading-splash message (diff)
downloadida-tui-215a607dc0007c9a0eb8f629547372e0e2735c02.tar.gz
ida-tui-215a607dc0007c9a0eb8f629547372e0e2735c02.tar.xz
ida-tui-215a607dc0007c9a0eb8f629547372e0e2735c02.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