hex.nvim icon indicating copy to clipboard operation
hex.nvim copied to clipboard

all file contents get overriden in <=16B files

Open litoj opened this issue 2 months ago • 3 comments

The vital functionality of undoing sth is broken. I somehow accidentally overwrote the entire line with the same hex values and now I have no way to go back.

This is a major problem, since it also automatically saved the file. I have no idea why or how it happened, but I certainly think it should never discard the editing history.

litoj avatar Oct 12 '25 15:10 litoj

I have been able to reproduce the problem now. When I set the filetype to xxd it automatically starts the plugin. All fine so far. But then when I want to to save it, even if nothing is edited, it ofter overrides the entire file with just one symbol that was at the end of the line, when the file was just one line long (hex line -> <=16 bytes). It happens with certain types of file contents, the details of which I am not able to figure out, but here is my file contents that caused it (in bytes) A3 90 21 01 FB

litoj avatar Oct 14 '25 11:10 litoj

Have you been able to reproduce this with more details?

yilisharcs avatar Oct 21 '25 09:10 yilisharcs

Other than that when I open the file with a maximum of 16B (5B in my case) to fit on one line and the last byte is FB it results in the file always saving the line as all FB overwriting the original contents even without change... No, not really :D

when I refresh the file/buffer it works as it was supposed to. But not on the initial open and :set ft=xxd

litoj avatar Oct 21 '25 17:10 litoj