Sometimes when editing binary files and embedding data into/from programs I 
have the need to hex copy/paste large segments of data. When I was working 
heavily with this in a private company we had 010 Editor which is simply 
amazing and has some options that I think could be replicated in Geany, they 
are:

- Paste from Hex
- Copy as Hex
- Copy as C array

Paste from Hex (ctrl+shift+v for example) takes data like:

54 52 55 45 56 49 53 49 4f 4e 2d 58 46 49 4c 45 2e

And  paste as:

TRUEVISION-XFILE.

And the opposite should be valid, copying (ctrl+shift+c for example) would turn 
this into the hex again.

Copying as C array would produce:

{ 0x54, 0x52, 0x55, 0x45, 0x56, 0x49, 0x53, 0x49,
0x4f, 0x4e, 0x2d, 0x58, 0x46, 0x49, 0x4c, 0x45,
0x2e }

Note the break at 8 bytes, could be configurable by the plugin maybe.

Paste from hex should also support pasting mixed represented hex data like:

41 0x42 43h 44H

Would produce:

ABCD

All blank spaces, tabs, cr and lf are ignored. In the case where there is no 
blank space each 2 bytes must represent an hex byte and the total length of the 
clipboard must be even.

In case of bad hex data the conversion should not be done, bad means anything 
not hex like:

4G H7

I could work the code to convert to/from in C language, I just don't know how 
to work with GUI and plugins so if someone is interested...

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/417

Reply via email to