Open CosminPerRam opened 1 year ago
Thank you for the report. I'll try to think about how to best support pasting data into an empty document, and support multiple formats to parse binary data from text.
Since Hexerator mainly deals with binary files, for which fixed length can be important, I don't want to silently expand the size of the binary file if the paste exceeds it. What I'm thinking of is displaying a message box that the paste exceeds the size, and ask the user whether they want to expand the file or not to continue with the paste.
However trying to implement this, I ran into some architectural problems with the UI of hexerator. I'll have to think about how to solve those problems before I can implement this in a satisfactory manner. Sorry in advance for the wait.
What I'm thinking of is displaying a message box that the paste exceeds the size, and ask the user whether they want to expand the file or not to continue with the paste.
Sounds nice, I think of this as being a setting (lets call it "do not exceed original size when pasting data" for example) that defaults to true.
Sorry in advance for the wait.
Absolutely no problem, thanks for considering it and sorry that I'm not able to help (skill issue). Godspeed.
Working on the UI side of things
Heyo, any updates?
Sorry, I've been not in the mood to do programming in the past few weeks. I'll try to do something about this in the next few days, but no promises.
No problem, it's understandable, take your time!
The current situation is, you can paste now (on git main branch) without panicking. You can choose the "Extend document" option. Then you can right click on the hex view and choose "Region properties" Then you can click the "Reset" button on the region to reset it to the new size.
I haven't yet determined how to do this automatically, because Hexerator views are flexible by default, so I don't want to accidentally overwrite a custom region without the user's consent.
Probably the way to go would be to properly establish the concept of "default" views/regions, which can be subject to automatic changes.
Regarding the crash: Let's say that I have this in my clipboard (as a string):
20 00 62 75 69 6C
, I open Hexerator (a new session) and i go Edit > Paste at cursor > Hex text from clipboard then boom, panic: As I often inspect hex from my clipboard (as I get it as output from my program) I would like to be able to directly paste it on a new session to inspect it.Regarding 'smart paste': Doing
println!("{:02X?}", data);
(where data is anVec<u8>
for example, it outputs in the console this string:[20, 00, 62, 75, 69, 6C]
, and I want to copy and paste it in the program (let's say without the ending square brackets (so my clipboard now is20, 00, 62, 75, 69, 6C
), i get this error: ... which is understandable as the string contains commas, but annoying as I have to get rid of all my commas to paste it in. Which is also a bit annoying as I apparently can't justCTRL + V
to paste it.