Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to insert bytes everywhere #31

Open
Mgamerz opened this issue Apr 30, 2018 · 14 comments
Open

Ability to insert bytes everywhere #31

Mgamerz opened this issue Apr 30, 2018 · 14 comments

Comments

@Mgamerz
Copy link

Mgamerz commented Apr 30, 2018

Expected Behavior

Using insert mode (Insert key) should allow me to insert bytes in at arbitrary points. I should be able to press backspace or delete to erase bytes, rather than reset to them to zero.

Actual Behavior

Insert doesn't seem to be possible, only appending. Deleting bytes, from what I can tell, just reset them to zero rather than actually wiping them.

Steps to Reproduce the Problem

Try to use insert or backspace/delete for bytes. It does not work.

@abbaye
Copy link
Owner

abbaye commented Apr 30, 2018

For info : Alway use HexaEditor You should not use DrawedHexEditor because it's a alpha stage.

The actual version support delete (anywhere) and insert byte (EOF only).

When you delete the byte reset to zero and turn to red... the byte will be really deleted when you save change to you file/stream

@Mgamerz
Copy link
Author

Mgamerz commented Apr 30, 2018

Would there be a way to add bytes via insert? Or have a toggle that will hide deleted bytes, even if I have not committed the actual backing stream?

@abbaye
Copy link
Owner

abbaye commented Apr 30, 2018

Not for now but soon :)

@abbaye
Copy link
Owner

abbaye commented Apr 30, 2018

Project are made in me free time

@abbaye
Copy link
Owner

abbaye commented Mar 3, 2019

Now you can insert byte at end of file.

When I have more time I will add the ability to insert byte anywhere

@vector-man
Copy link

vector-man commented Mar 17, 2019

@Mgamerz I plan on making dialogs for this for now. Might be a workaround for you. Something like the following: https://www.sweetscape.com/010editor/manual/InsertBytes.htm

@abbaye
Copy link
Owner

abbaye commented Mar 17, 2019

It's a good idea and a good solution for insert byte anywhere.

I think I can make a real-time insert bytes in control. (I just need more free time for me...)

@Mgamerz
Copy link
Author

Mgamerz commented Mar 17, 2019

Unfortunately, I just used Be.Hexbox in a hosted control, and for the most part have completed my project. It works, for the most part.

@vector-man
Copy link

vector-man commented Mar 17, 2019

@abbaye I have not thoroughly examined the ByteProvider, but I'm thinking something like this:

Add a List called _insertions
Add a long called _insertionStart
When insert key is pressed, the UI enters insertion mode, _insertionStart is set to caret position offset.
When typing in insertion mode, add the bytes, not directly to the stream, but to the _insertion list.

When doing rendering:
Render everything from the start of the stream before the offset of _insertionStart , followed by everything in _insertions (up until _insertionStart + _insertion.Count()), finally everything in the stream at the offset _insertionStart. This will give the appearance that data is inserted in the UI.

When insertion is ended, we can update the stream by

  1. Resizing the stream length to length + _insertionCount (zero fill the end)
  2. Overwriting the stream at offset _insertionStart + _insertion.Count() with copied stream data at offset _insertionStart (not reading from _insertions, but the actual stream). This will create room for step3
  3. Seeking back to _insertionStart and writing _insertions data

Just an idea.

@abbaye
Copy link
Owner

abbaye commented Mar 18, 2019

Hi vector-man.

Yes is a think like this. :)

I'm at the end of my University's session (ending ~17 April). After that I will can work on insert byte (everywhere)

@abbaye abbaye pinned this issue Apr 15, 2019
@abbaye abbaye self-assigned this Apr 15, 2019
@WrongBit
Copy link

Any progress on ADDING ONE BYTE??? :) It's ridiculous, heh... Standard editing function and so much awaiting.
One more note: control sources look overbloated for such simplistic task - edit hex bytes!
And sorry, but better you made "adding byte" function than waste time on... translation! If you edit HEX, you definitely KNOW english!

@abbaye
Copy link
Owner

abbaye commented Oct 11, 2020

Hi @WrongBit

I know that inserting byte is a basic function ... but I build this control for fun and when I have free time in my real life (I have one 😅). Adding this bug-free feature takes a long time and I don't have much at the moment. I hope to be able to work on this function this winter.

For your information: Some features I added were added because they were quick to implement.

On the other hand, if you want to code the functionality and send a "pull resquest" 😀 I will be happy to add it later ...

PS: It is more interesting to contribute in a project than to send this type of message to a guy who gives his time for free. Your Github profile is empty, you should probably have some time to code the byte insertion. 😅😁

kind regards...

abbaye added a commit that referenced this issue Jan 13, 2021
abbaye added a commit that referenced this issue Feb 10, 2021
abbaye added a commit that referenced this issue Feb 11, 2021
abbaye added a commit that referenced this issue Feb 28, 2021
…abbility to insert anywhere... courage is on the way !!
@abbaye abbaye changed the title Ability to insert and delete bytes Ability to insert bytes everywhere May 31, 2021
@vector-man
Copy link

Hey there. I think I'm going to take try at adding this feature soon. If I do, I'll send a pull request after I get it working well.

@abbaye
Copy link
Owner

abbaye commented Nov 4, 2022

Thank you very much!

I want to work on this project but I'm working on the last 6 months over 70 by week. 😵‍💫😅

Thank for you help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants