viewer / quick view mode
Miven Dooligan
dooligan at intergate.ca
Sun Oct 6 23:35:20 UTC 2002
Hello.
I can see what you meant when you said the hex viewer is just one big
hack. It looks like one of those cool after-thoughts, that kept getting
more and more features ("I just need to fix two bytes! Can you make it
edit?"). I've always felt that it deserves its own subdir like the editor.
So, I've been beating on the viewer a bit.
Some more stuff for your Hex Editor Fixit List:)
If I have the right panel set to 80 columns, quick view/hex mode won't
do 16 byte rows, I have to go up to 82 columns. I see that's because of
the 2 columns used by the border. It bumps down to 12 byte rows even
though there's still plenty of room. Perhaps we can get rid of the
vertical bars separating the 4 byte groups, and it would do 16 byte rows
even at 76 columns, with just a double space between 4 byte columns. Of
course, then it doesn't look as good on standard 80 column displays,
with a big gap between the hex and text areas, so we leave them alone
unless view->widget.cols < 80.
The attached patch does the job for that.
hunk1: fixes bytes per line when cols < 80.
hunk2: stops printing vline when cols < 80
hunk3: fixes missing space between addresses and hexdump when
view->have_frame.
Another mention is that the hex mode of the viewer grabs the TAB key for
flipping between hex and text fields. It means you have to use your
mouse to get into the other panel in quick view/hex mode, and you can't
TAB back into the hex editor either or even use the mouse to get back
in, so you're stuck in hex mode. The TAB key just seems to stop
working. I have to exit mc and restart it to get it back.
If I switch the panel to info mode, then back to hex view mode, the hex
output is all on just one line, running right off the edge of the
screen, or sometimes just a single column of bytes. If you do a
sigwinch a few columns to where it would have to recalculate
bytes_per_line anyway, it fixes itself. It seems to miss
view_update_bytes_per_line() under some situations, or view->widget.cols
is not set properly. I'm not at all sure where that one comes from.
One other thing about the viewer: if you resize your window badly while
in the viewer (either mode) or editor and return it to its original
size, when you leave the viewer, the left panel has been resized (much
smaller). It seems the sigwinch handler fixes the panels even when in
the viewer/editor and doesn't try to return them to their original
values (as per ini). It almost calls for the ability to pull the panel
divider back and forth with the mouse.
Cheers,
Mr.Picky :)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hexedit-column-fix.patch
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20021006/2e7afd2e/attachment.ksh>
More information about the mc-devel
mailing list