hexedit icon indicating copy to clipboard operation
hexedit copied to clipboard

Add relative jump support to goto functionality

Open 9init opened this issue 3 months ago • 0 comments

Add relative jump support to goto functionality

This PR adds support for relative jumps in hexedit's goto feature (Ctrl+G, F4, Enter). Users can now specify relative offsets using + or - prefixes to jump forward or backward from the current position.

Changes Made

  • Added parsing for + and - prefixes to detect relative jumps
  • Implemented relative position calculation based on current cursor position (base + cursor)
  • Added underflow protection (negative results are clamped to position 0)
  • Maintains full backward compatibility with absolute addresses

Usage Examples

  • +0x12 - Jump forward 18 bytes (0x12 = 18 decimal)
  • -0x12 - Jump backward 18 bytes
  • +100 - Jump forward 100 bytes
  • -50 - Jump backward 50 bytes
  • 0x200 - Jump to absolute position 0x200 (existing functionality preserved)

9init avatar Sep 25 '25 14:09 9init