aboutsummaryrefslogtreecommitdiffstats
path: root/idatui
diff options
context:
space:
mode:
Diffstat (limited to 'idatui')
-rw-r--r--idatui/app.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/idatui/app.py b/idatui/app.py
index 0012e32..f79d04d 100644
--- a/idatui/app.py
+++ b/idatui/app.py
@@ -1449,8 +1449,13 @@ class DecompView(SearchMixin, NavMixin, ColumnCursor, ScrollView, can_focus=True
Binding("ctrl+u", "half_page(-1)", "½↑", show=False),
Binding("pagedown", "page(1)", "PgDn", show=False),
Binding("pageup", "page(-1)", "PgUp", show=False),
- Binding("home", "goto_top", "Top", show=False),
- Binding("G,end", "goto_bottom", "Bottom", show=False),
+ # Home/End move the cursor along the line (as in the listing); top and
+ # bottom of the function move to the ctrl+ pair (G still works too).
+ Binding("home", "col_home", "bol", show=False),
+ Binding("shift+home", "col_code_home", "code start", show=False),
+ Binding("end", "col_end", "eol", show=False),
+ Binding("ctrl+home", "goto_top", "Top", show=False),
+ Binding("G,ctrl+end", "goto_bottom", "Bottom", show=False),
*SearchMixin.SEARCH_BINDINGS,
*NavMixin.NAV_BINDINGS,
*ColumnCursor.COL_BINDINGS,
@@ -1649,6 +1654,15 @@ class DecompView(SearchMixin, NavMixin, ColumnCursor, ScrollView, can_focus=True
if round(old_value) != round(new_value):
self.post_message(DecompView.Scrolled())
+ def action_col_code_home(self) -> None:
+ """shift+home: first non-blank column — past the C indentation, the
+ pseudocode analogue of the listing's skip-the-address-gutter."""
+ text = self._line_plain(self.cursor) or ""
+ self.cursor_x = len(text) - len(text.lstrip()) if text.strip() else 0
+ self._hscroll()
+ _refresh_lines(self, self.cursor)
+ self._refresh_hl()
+
def line_for_ea(self, ea: int) -> int | None:
"""The pseudocode line whose marker ea is the largest <= ``ea`` (the C
line that best covers an instruction address)."""