hexedit
hexedit copied to clipboard
Add relative jump support to goto functionality
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 bytes0x200- Jump to absolute position 0x200 (existing functionality preserved)