79d00e2372
tlcview now supports in-place byte-level editing in Hex view:
F4 (Text -> Hex), F2 (Hex -> HexEdit) toggles between read-only
hex view and an editable overlay. HexEdit mode draws an extra-
bright cursor over the *active nibble* (H or L) so the user
always knows which digit the next keystroke will replace.
Nibble pipeline (mirror of MC's mcedit hex cursor):
- type 'a'..'f' or '0'..'9': stash the high nibble and advance
to the low nibble; the byte is NOT yet written
- second nibble: combine with stashed high, write the byte,
advance the cursor by 1, reset to high nibble
- arrow keys: H/L toggle (Right/Left), row navigation (Up/Down),
page jump (PgUp/PgDn)
- F10/Esc/Ctrl-Q on a dirty buffer opens the
'Save before quit? (Y/N/Esc)' prompt; Y saves, N discards,
Esc cancels and stays in HexEdit
Byte storage:
- Inline and Compressed sources (the default for files < 1 MiB
and all .gz/.bz2) are mutated in place via the new
FileSource::write_byte(offset, value) helper.
- FileSource::save_to(path) persists the buffer byte-exact.
- Chunked sources (≥ 1 MiB plain files) refuse to enter
HexEdit — caller gets a silent no-op. The new
SourceError::NotMutable variant carries the diagnostic.
Header / footer:
- mode label changes from 'Hex' to 'HexEdit' in the header
- footer shows 'Nibble H' or 'Nibble L' (which digit is next)
- '[+]' marker appears after the mode label when the buffer
has unsaved edits
8 new tests cover: F2 enter, nibble commit + cursor advance,
dirty F10 opens prompt, clean F10 closes, Y/N/Esc prompt
resolution, Chunked refusal, arrow-key nibble toggling.
Total: 1172 tests passing, 0 failing.