Open nevumx opened 1 week ago
Not exactly sure who to tag here... @Wolfvak / @d0k3 ? Anyone else?
Could the hex editing functionality be added to the hex viewer as well?
Could the hex editing functionality be added to the hex viewer as well?
The hex viewer has had edit functionality since 2016: https://github.com/d0k3/GodMode9/commit/88a62d8f2ecc50f1ee99e0a08359ae85d02dd0f3
FYI @d0k3 / @Wolfvak I have added clipboard select/cut/copy/paste support as well. The description has been updated!
Pursuant to my feature request https://github.com/d0k3/GodMode9/issues/861, I am pleased to present my proposal PR for adding text editor functionality to the existing text viewer by repurposing the existing keyboard that is used for file renames.
Features:
Screenshots:
![snap_240627161245](https://github.com/d0k3/GodMode9/assets/8940345/389efbd0-a09d-4ec6-8531-cae3121569ec)
Considerations:
if
statements around, for example, when the last line is a certain length.InputWait(1)
, but that resulted in inputs getting dropped occasionally when pressing a button betweenInputWait
calls when the screen was being drawn.<threads.h>
compiled, the thread would never spawn due tothrd_error
... I am guessing threads are out of scope for this project, since I don't see them anywhere else, definitely open to other suggestions on this...Definitely open to suggestions on this, especially as it relates to key bindings/text/etc. ALSO, please do test in any/every way you can think of; I had a reasonably robust set of test files, but it's always possible that there was an edge case I missed. And translations; not sure what can be done in that regard in this PR...
EDIT: I have added clipboard functionality. For example, if we are in this file:
And we press "L+→", we start a selection:
Where we can continue this to the end of the line with additional "L+→" or "R+→" presses:
And go downwards with "L+↓" or "R+↓":
Then we can copy that text with "Y" or cut it with "R+Y":
And paste it in again with "Y":
And paste more times with the same clipboard data:
And then we can clear the clipboard with "R+Y":
![snap_240704151618](https://github.com/d0k3/GodMode9/assets/8940345/d6ee6e5e-4d31-4ef1-b133-7c49452e1224)
Any comments/suggestions are appreciated!