mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 17:29:28 +03:00
* view.c (view_update_bytes_per_line): Don't use vertical bars
in the hex viewer is short of space. Fix missing space between addresses and hexdump when framed. (display): Likewise.
This commit is contained in:
parent
604950704a
commit
a67eb057ec
@ -1,3 +1,10 @@
|
|||||||
|
2002-10-07 Miven Dooligan <dooligan@intergate.ca>
|
||||||
|
|
||||||
|
* view.c (view_update_bytes_per_line): Don't use vertical bars
|
||||||
|
in the hex viewer is short of space. Fix missing space between
|
||||||
|
addresses and hexdump when framed.
|
||||||
|
(display): Likewise.
|
||||||
|
|
||||||
2002-10-07 Pavel Roskin <proski@gnu.org>
|
2002-10-07 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* selcodepage.c (select_charset): Use g_snprintf() instead
|
* selcodepage.c (select_charset): Use g_snprintf() instead
|
||||||
|
29
src/view.c
29
src/view.c
@ -636,7 +636,7 @@ finish:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
view_update_bytes_per_line(WView *view)
|
view_update_bytes_per_line (WView *view)
|
||||||
{
|
{
|
||||||
int cols;
|
int cols;
|
||||||
|
|
||||||
@ -646,11 +646,14 @@ view_update_bytes_per_line(WView *view)
|
|||||||
cols = view->widget.cols;
|
cols = view->widget.cols;
|
||||||
|
|
||||||
view->bottom_first = -1;
|
view->bottom_first = -1;
|
||||||
view->bytes_per_line = ((2 * (cols - 8) / 9) & 0xfffc);
|
if (cols < 80)
|
||||||
|
view->bytes_per_line = ((cols - 8) / 17) * 4;
|
||||||
|
else
|
||||||
|
view->bytes_per_line = ((cols - 8) / 18) * 4;
|
||||||
|
|
||||||
if (view->bytes_per_line == 0)
|
if (view->bytes_per_line == 0)
|
||||||
view->bytes_per_line++; /* To avoid division by 0 */
|
view->bytes_per_line++; /* To avoid division by 0 */
|
||||||
|
|
||||||
view->dirty = max_dirt_limit + 1; /* To force refresh */
|
view->dirty = max_dirt_limit + 1; /* To force refresh */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -778,7 +781,7 @@ typedef enum {
|
|||||||
|
|
||||||
/* Shows the file pointed to by *start_display on view_win */
|
/* Shows the file pointed to by *start_display on view_win */
|
||||||
static long
|
static long
|
||||||
display (WView * view)
|
display (WView *view)
|
||||||
{
|
{
|
||||||
const int frame_shift = view->have_frame;
|
const int frame_shift = view->have_frame;
|
||||||
int col = 0 + frame_shift;
|
int col = 0 + frame_shift;
|
||||||
@ -853,7 +856,10 @@ display (WView * view)
|
|||||||
attrset (NORMAL_COLOR);
|
attrset (NORMAL_COLOR);
|
||||||
|
|
||||||
/* Hex dump starts from column nine */
|
/* Hex dump starts from column nine */
|
||||||
col = 9;
|
if (view->have_frame)
|
||||||
|
col = 10;
|
||||||
|
else
|
||||||
|
col = 9;
|
||||||
|
|
||||||
/* Each hex number is two digits */
|
/* Each hex number is two digits */
|
||||||
hex_buff[2] = 0;
|
hex_buff[2] = 0;
|
||||||
@ -908,8 +914,13 @@ display (WView * view)
|
|||||||
view_gotoyx (view, row, col - 1);
|
view_gotoyx (view, row, col - 1);
|
||||||
view_add_character (view, ' ');
|
view_add_character (view, ' ');
|
||||||
view_gotoyx (view, row, col);
|
view_gotoyx (view, row, col);
|
||||||
view_add_one_vline ();
|
if ((view->have_frame && view->widget.cols < 82) ||
|
||||||
col += 2;
|
view->widget.cols < 80)
|
||||||
|
col += 1;
|
||||||
|
else {
|
||||||
|
view_add_one_vline ();
|
||||||
|
col += 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (boldflag != MARK_NORMAL
|
if (boldflag != MARK_NORMAL
|
||||||
&& from ==
|
&& from ==
|
||||||
|
Loading…
Reference in New Issue
Block a user