-
Notifications
You must be signed in to change notification settings - Fork 94
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
Edit mode and input byte insertion #503
Conversation
Allows to manually insert bytes into the file, just like replace. To choose between these, there is a edit mode that can be changed either in the status bar or through a command. To visually distinguish them inside the editor, each mode has an unique cursor on the focusedByte. When Inserting the cursor is a text cursor and in Replacing it is a box.
Changed cursor color in insertion and replacement to match editor's cursor
Initially was using a text cursor to append at a certain offset, but it was terrible UX due to having to specifically click on the rhs of the offset. So I opted to add an extra data cell at the end with a "+" icon. This way the user can easily figure out how to append bytes and does not complicate byte insertion.
Fixed inserting an invalid key shifts the focusedElement Refactored newValue logic to use parseHexDigit
Some comments, great job with this PR though, it looks super cool. Let me know if you want help with append behavior. |
Thank you for the taking the time to comment! I will carefully go through all of them tomorrow as it is getting late here. At the moment, I am not entirely sure if it is a good idea to have |
I think it would probably be easier to try to join them together, since there's a lot of overlap between them. But I may be wrong, I'm not convicted one way or the other at this point. |
Removed useMemo from editStyle
Made AppendDataCell as a secondary button. Fixed selection superimposing replace outline
Apologies for the late message. I have gone through all the comments, so I hope the code is better now. At the moment, my biggest concern is related to #511 since, with this feature, it has become a lot easier to encounter it. I will try to figure out what is causing before opening the PR for merge. Just want to say, again, thank you for the comments. They implicitly answered some questions I was having. |
I have somewhat figured out what is causing #511 , so I think we can merge this. I am still working on a proper fix, as the problem is rather complex. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks great. Could hardly have done it better myself :) Just a few small comments but then this should be good to merge
Co-authored-by: Connor Peet <[email protected]>
Thank you for the help and approving! |
If there any chance to provide that for normal editors, giving the long standing (2015) microsoft/vscode#1012? |
Opening a PR for some early feedback on the feature.
Introduces input byte insertion and edit mode to switch between insertion and replacing.
To choose between these, there is a edit mode that can be changed either in the status bar or through a command.
To visually distinguish them inside the editor, each mode has an unique cursor on the focusedByte. When Inserting, the cursor is a text cursor and in Replacing, it is a box.
Inserting
Replacing
At the moment, it is not possible to insert at the end of the file and there are some annoying bugs. But, hopefully, it provides a good picture on how input byte insertion/replacing can be.