stef-levesque / vscode-hexdump

hexdump for Visual Studio Code
MIT License
138 stars 27 forks source link

Ability to change multiple bytes at once #42

Closed raphaklaus closed 6 years ago

raphaklaus commented 6 years ago

Hey! Excellent work on doing this extension!

It'd be awesome the ability to change multiple bytes at once, like using ctrl+v to paste a binary content inside a file for example. Is there any effort on this?

stef-levesque commented 6 years ago

Editing the values in place could easily be feasible. The workflow would be

  1. Select the region to edit.
  2. Hit Shift+Enter - Edit Value.
  3. Paste the hexadecimal content, in a single line, into the dialog prompt.

As for intercepting the Ctrl+V command from the editor, it might not be easy. The editor is in read-only mode, because it doesn't make sense to edit the Address or Offset regions, and it would be hard to enforce the formatting this way.

Another way would be to change the read-only editor for a dynamic HTML page displaying in a WebView, but I don't what to go this way. At least, not for now.

raphaklaus commented 6 years ago

I think the ctrl+v could be initially inside the dialog prompt whereas it changes all selected bytes.

stef-levesque commented 6 years ago

Thanks to @J1T0 and PR #45 we now have a way to edit multiply bytes at the time. Hit Shift-Enter where you want to start editing, and use the input box to enter or paste a hexadecimal string as long as you want.