d0k3 / GodMode9

GodMode9 Explorer - A full access file browser for the Nintendo 3DS console :godmode:
GNU General Public License v3.0
2.07k stars 192 forks source link

Adding text editor functionality to text viewer. #868

Open nevumx opened 1 week ago

nevumx commented 1 week ago

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_240627192950 snap_240627161019 snap_240627161030 snap_240627161239 snap_240627161245

Considerations:

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: snap_240704151448 And we press "L+→", we start a selection: snap_240704151453 Where we can continue this to the end of the line with additional "L+→" or "R+→" presses: snap_240704151457 And go downwards with "L+↓" or "R+↓": snap_240704151504 Then we can copy that text with "Y" or cut it with "R+Y": snap_240704151531 And paste it in again with "Y": snap_240704151535 And paste more times with the same clipboard data: snap_240704151614 And then we can clear the clipboard with "R+Y": snap_240704151618

Any comments/suggestions are appreciated!

nevumx commented 1 week ago

Not exactly sure who to tag here... @Wolfvak / @d0k3 ? Anyone else?

Trickiy commented 1 week ago

Could the hex editing functionality be added to the hex viewer as well?

nevumx commented 1 week ago

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

nevumx commented 5 days ago

FYI @d0k3 / @Wolfvak I have added clipboard select/cut/copy/paste support as well. The description has been updated!