1
1

* view.c (display): Renamed frame_shift to left or top, whatever

is more appropriate.
Этот коммит содержится в:
Roland Illig 2005-04-17 11:35:31 +00:00
родитель 0dc31ebb6c
Коммит 18325716b1
2 изменённых файлов: 18 добавлений и 15 удалений

Просмотреть файл

@ -24,6 +24,8 @@
* view.c (display): Renamed width and height to right and bottom. * view.c (display): Renamed width and height to right and bottom.
The values of the variables aren't really the width and height The values of the variables aren't really the width and height
of anything. of anything.
* view.c (display): Renamed frame_shift to left or top, whatever
is more appropriate.
2005-04-16 Roland Illig <roland.illig@gmx.de> 2005-04-16 Roland Illig <roland.illig@gmx.de>

Просмотреть файл

@ -865,10 +865,10 @@ static inline int view_count_backspaces (WView *view, off_t offset)
static offset_type static offset_type
display (WView *view) display (WView *view)
{ {
/* FIXME: replace with better named variables */ const int left = view_get_left (view);
const int frame_shift = view->dpy_frame_size; const int top = view_get_top (view);
int col = 0 + frame_shift; int col = left;
int row = STATUS_LINES + frame_shift; int row = view_get_top (view);
int bottom, right; int bottom, right;
offset_type from; offset_type from;
int c; int c;
@ -889,7 +889,7 @@ display (WView *view)
int cl; int cl;
attrset (MARKED_COLOR); attrset (MARKED_COLOR);
for (c = frame_shift; c < right; c++) { for (c = left; c < right; c++) {
/* FIXME: possible integer overflow */ /* FIXME: possible integer overflow */
cl = c + view->dpy_text_start_col; cl = c + view->dpy_text_start_col;
if (ruler == 1) if (ruler == 1)
@ -923,15 +923,15 @@ display (WView *view)
char hex_buff[10]; /* A temporary buffer for sprintf and mvwaddstr */ char hex_buff[10]; /* A temporary buffer for sprintf and mvwaddstr */
int bytes; /* Number of bytes already printed on the line */ int bytes; /* Number of bytes already printed on the line */
/* Start of text column; keep the last column empty */ /* Start of text column */
int text_start = frame_shift + right - (view->bytes_per_line + 1); int text_start = right - view->bytes_per_line
- view_is_in_panel (view) ? 0 : 1;
for (; get_byte (view, from) != -1 for (; get_byte (view, from) != -1 && row < bottom; row++) {
&& row < bottom; row++) {
/* Print the hex offset */ /* Print the hex offset */
attrset (MARKED_COLOR); attrset (MARKED_COLOR);
g_snprintf (hex_buff, sizeof (hex_buff), OFFSETTYPE_PRIX, from); g_snprintf (hex_buff, sizeof (hex_buff), OFFSETTYPE_PRIX, from);
view_gotoyx (view, row, frame_shift); view_gotoyx (view, row, left);
view_add_string (view, hex_buff); view_add_string (view, hex_buff);
attrset (NORMAL_COLOR); attrset (NORMAL_COLOR);
@ -1051,7 +1051,7 @@ display (WView *view)
} else { } else {
for (; row < bottom && (c = get_byte (view, from)) != -1; from++) { for (; row < bottom && (c = get_byte (view, from)) != -1; from++) {
if ((c == '\n') || (col >= right && view->text_wrap_mode)) { if ((c == '\n') || (col >= right && view->text_wrap_mode)) {
col = frame_shift; col = left;
row++; row++;
if (c == '\n' || row >= bottom) if (c == '\n' || row >= bottom)
continue; continue;
@ -1059,7 +1059,7 @@ display (WView *view)
if (c == '\r') if (c == '\r')
continue; continue;
if (c == '\t') { if (c == '\t') {
col = ((col - frame_shift) / 8) * 8 + 8 + frame_shift; col = ((col - left) / 8) * 8 + 8 + left;
continue; continue;
} }
if (view->text_nroff_mode && c == '\b') { if (view->text_nroff_mode && c == '\b') {
@ -1073,9 +1073,10 @@ display (WView *view)
&& is_printable (c_prev) && is_printable (c_prev)
&& (c_prev == c_next || c_prev == '_' && (c_prev == c_next || c_prev == '_'
|| (c_prev == '+' && c_next == 'o'))) { || (c_prev == '+' && c_next == 'o'))) {
if (col <= frame_shift) { if (col <= left) {
/* So it has to be text_wrap_mode - do not need to check for it */ /* So it has to be text_wrap_mode - do not need to check for it */
if (row == 1 + frame_shift) { /* FIXME: what about the ruler? */
if (row == 1 + top) {
from++; from++;
continue; /* There had to be a bold character on the rightmost position continue; /* There had to be a bold character on the rightmost position
of the previous undisplayed line */ of the previous undisplayed line */
@ -1098,7 +1099,7 @@ display (WView *view)
attrset (SELECTED_COLOR); attrset (SELECTED_COLOR);
} }
/* FIXME: incompatible widths in integer types */ /* FIXME: incompatible widths in integer types */
if (col >= frame_shift + view->dpy_text_start_col if (col >= left + view->dpy_text_start_col
&& col < right + view->dpy_text_start_col) { && col < right + view->dpy_text_start_col) {
view_gotoyx (view, row, col - view->dpy_text_start_col); view_gotoyx (view, row, col - view->dpy_text_start_col);