cutter/src
Premade 867c54e838
Optimize disassembly scroll and selection logic (#3646)
1. Scroll by visual lines instead of disassembly lines (see #3604)

Previously whenever a scroll happened, cutter cleared all of the disassembled
lines it had and queried rizin again, even if the scroll was only for one
instruction. This causes two problems:

* All of the lines have to be queried again making scrolling slow.
* Since an instruction can have multiple metadata lines attached to it, it meant
  that whenever a user scrolled a single instruction all of the metadata lines
  will also be scrolled - making scrolling feel choppy.

To solve this we keep a buffer of "max visible lines * 5" which is filled in as
user scrolls, meaning at first only "max visible lines" are queried from rizin,
if user scrolls upwards the entire "max visible lines" above the current top
instruction is fetched and prepended to our "lines" buffer. Since the previous
lines are still saved - if the user scrolls back down we can just show those
specific lines from our buffer instead of querying again.

Lines are erased from start or end based on scroll direction if the buffer
exceeds the size cap of "max visible lines * 5" The "lines" buffer is fully
cleared if user seeks to some address using some external signal - like the
Visual nav bar at the top (basically seeking using any method other than
directly clicking on the instruction line itself)

2. Adds infinite selection via mouse and keyboard

There was no way in cutter to select more lines than whats currently shown on
screen and there was also no way to select text via keyboard. This is done via
manually handling the selection instead of letting Qt handle it. The selection
is preserved no matter how far user scrolls up or down.

3. Fixes empty space at the bottom of disassembly widget viewport

Whenever "max visible lines" were calculated it didn't account for the fact that
the last line might be partially visible meaning there is not enough space to
display it fully, which created empty space at the bottom

4. Adds a visible/blinking cursor to the disassembly panel

Avoids the issue of not knowing which line we are on, if the line contains
similar text that is highlighted. Also helps to know where selection will start
using physical keys
2026-07-17 12:52:28 +02:00
..
bindings Refactor code to match new style (#3612) 2026-05-21 14:26:49 +05:00
common Optimize disassembly scroll and selection logic (#3646) 2026-07-17 12:52:28 +02:00
core Add tab in preferences to query/modify rizin evars (#3615) 2026-06-21 13:04:48 +08:00
dialogs Add tab in preferences to query/modify rizin evars (#3615) 2026-06-21 13:04:48 +08:00
fonts First code commit 2017-03-29 12:18:37 +02:00
img Add tab in preferences to query/modify rizin evars (#3615) 2026-06-21 13:04:48 +08:00
menus Use rizin api for setting fcn calling convention (#3616) 2026-06-20 22:16:21 +05:00
plugins Refactor code to match new style (#3612) 2026-05-21 14:26:49 +05:00
python Code cleanup (#1535) 2019-05-17 13:40:50 +02:00
shortcuts Optimize disassembly scroll and selection logic (#3646) 2026-07-17 12:52:28 +02:00
themes Improve inefficient screen space usage (#3580) 2026-04-17 16:53:24 +05:00
tools/basefind Refactor code to match new style (#3612) 2026-05-21 14:26:49 +05:00
translations@fa68a9fec3 Update translations (#3627) 2026-06-21 17:18:26 +08:00
widgets Optimize disassembly scroll and selection logic (#3646) 2026-07-17 12:52:28 +02:00
CMakeLists.txt cmake: add CUTTER_ENABLE_TRANSLATIONS option to skip translation build (#3640) 2026-07-02 16:43:10 +05:00
CutterApplication.cpp Refactor code to match new style (#3612) 2026-05-21 14:26:49 +05:00
CutterApplication.h Refactor code to match new style (#3612) 2026-05-21 14:26:49 +05:00
CutterConfig.h.in Remove qmake (#2546) 2021-01-10 13:07:39 +02:00
Main.cpp Refactor code to match new style (#3612) 2026-05-21 14:26:49 +05:00
re.rizin.cutter.appdata.xml Bump Cutter version to 2.5.0 (#3635) 2026-06-27 12:37:14 +02:00
re.rizin.cutter.desktop Added metainfo file to the installation. (#3346) 2024-05-29 19:53:52 +03:00
resources.qrc Add tab in preferences to query/modify rizin evars (#3615) 2026-06-21 13:04:48 +08:00