-
Notifications
You must be signed in to change notification settings - Fork 8
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
Confusing editor behavior #17
Comments
Hmm, I understand Yes rn you are allowed to type stuff other than 00 - FF which isn't ideal but afaik there isn't a "sane" way of preventing it. The way it works is it dumps the bytes of a file into a buffer, you then can edit your "hex/bytes" are with just |
What happens if you put something else there besides 00-FF though? It just feeds that to xxd and it depends on how it handles it? |
That might be very suboptimal, but is there a way to put a hook on any key input and if it's within the hex plane, it can filter what input is allowed. Something like this may be? |
Turns out it's totally possible to control what char insert on each key press. vim.api.nvim_create_autocmd({ "InsertCharPre" }, {
callback = function(ev)
if (vim.v.char == "s") then
vim.v.char = ''
end
end
}) However that doesn't include other content modification methods like replacing, pasting, inc, dec .. etc I might implement just the char inserting snippet above tho |
Yeah, that sounds like it could improve things somewhat! Like you can check for the allowed range of characters for example. |
May be I'm not getting how this plugin works, but when in the hex / bytes area, I can input any text there, not just 00 - FF values. Is that intended? It feels confusing or at least not correct for hex editing.
The text was updated successfully, but these errors were encountered: