10713 |
int dy = it.current_y - first_row_y; |
int dy = it.current_y - first_row_y; |
10714 |
|
|
10715 |
row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
10716 |
while (MATRIX_ROW_DISPLAYS_TEXT_P (row)) |
row = row_containing_pos (w, PT, row, NULL, dy); |
10717 |
{ |
if (row) |
10718 |
if (PT >= MATRIX_ROW_START_CHARPOS (row) |
set_cursor_from_row (w, row, w->current_matrix, 0, 0, |
10719 |
&& PT < MATRIX_ROW_END_CHARPOS (row)) |
dy, nrows_scrolled); |
10720 |
{ |
else |
|
set_cursor_from_row (w, row, w->current_matrix, 0, 0, |
|
|
dy, nrows_scrolled); |
|
|
break; |
|
|
} |
|
|
|
|
|
if (MATRIX_ROW_BOTTOM_Y (row) + dy >= it.last_visible_y) |
|
|
break; |
|
|
|
|
|
++row; |
|
|
} |
|
|
|
|
|
/* Give up if point was not found. This shouldn't |
|
|
happen often; not more often than with try_window |
|
|
itself. */ |
|
|
if (w->cursor.vpos < 0) |
|
10721 |
{ |
{ |
10722 |
clear_glyph_matrix (w->desired_matrix); |
clear_glyph_matrix (w->desired_matrix); |
10723 |
return 0; |
return 0; |
11193 |
containing CHARPOS or null. */ |
containing CHARPOS or null. */ |
11194 |
|
|
11195 |
struct glyph_row * |
struct glyph_row * |
11196 |
row_containing_pos (w, charpos, start, end) |
row_containing_pos (w, charpos, start, end, dy) |
11197 |
struct window *w; |
struct window *w; |
11198 |
int charpos; |
int charpos; |
11199 |
struct glyph_row *start, *end; |
struct glyph_row *start, *end; |
11200 |
|
int dy; |
11201 |
{ |
{ |
11202 |
struct glyph_row *row = start; |
struct glyph_row *row = start; |
11203 |
int last_y; |
int last_y; |
11209 |
if ((end && row >= end) || !row->enabled_p) |
if ((end && row >= end) || !row->enabled_p) |
11210 |
return NULL; |
return NULL; |
11211 |
|
|
11212 |
last_y = window_text_bottom_y (w); |
last_y = window_text_bottom_y (w) - dy; |
11213 |
|
|
11214 |
while ((end == NULL || row < end) |
while ((end == NULL || row < end) |
11215 |
|
&& MATRIX_ROW_BOTTOM_Y (row) < last_y |
11216 |
&& (MATRIX_ROW_END_CHARPOS (row) < charpos |
&& (MATRIX_ROW_END_CHARPOS (row) < charpos |
|
/* The end position of a row equals the start |
|
|
position of the next row. If CHARPOS is there, we |
|
|
would rather display it in the next line, except |
|
|
when this line ends in ZV. */ |
|
11217 |
|| (MATRIX_ROW_END_CHARPOS (row) == charpos |
|| (MATRIX_ROW_END_CHARPOS (row) == charpos |
11218 |
&& (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row) |
/* The end position of a row equals the start |
11219 |
|| !row->ends_at_zv_p))) |
position of the next row. If CHARPOS is there, we |
11220 |
&& MATRIX_ROW_BOTTOM_Y (row) < last_y) |
would rather display it in the next line, except |
11221 |
|
when this line ends in ZV. */ |
11222 |
|
&& !row->ends_at_zv_p |
11223 |
|
&& !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)))) |
11224 |
++row; |
++row; |
11225 |
|
|
11226 |
/* Give up if CHARPOS not found. */ |
/* Give up if CHARPOS not found. */ |
11429 |
} |
} |
11430 |
|
|
11431 |
/* Set the cursor. */ |
/* Set the cursor. */ |
11432 |
row = row_containing_pos (w, PT, r0, NULL); |
row = row_containing_pos (w, PT, r0, NULL, 0); |
11433 |
set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); |
set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); |
11434 |
return 1; |
return 1; |
11435 |
} |
} |
11467 |
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); |
= Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); |
11468 |
|
|
11469 |
/* Set the cursor. */ |
/* Set the cursor. */ |
11470 |
row = row_containing_pos (w, PT, r0, NULL); |
row = row_containing_pos (w, PT, r0, NULL, 0); |
11471 |
set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); |
set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); |
11472 |
return 2; |
return 2; |
11473 |
} |
} |
11681 |
{ |
{ |
11682 |
row = row_containing_pos (w, PT, |
row = row_containing_pos (w, PT, |
11683 |
MATRIX_FIRST_TEXT_ROW (w->current_matrix), |
MATRIX_FIRST_TEXT_ROW (w->current_matrix), |
11684 |
last_unchanged_at_beg_row + 1); |
last_unchanged_at_beg_row + 1, 0); |
11685 |
if (row) |
if (row) |
11686 |
set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); |
set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); |
11687 |
} |
} |
11690 |
else if (first_unchanged_at_end_row) |
else if (first_unchanged_at_end_row) |
11691 |
{ |
{ |
11692 |
row = row_containing_pos (w, PT - delta, |
row = row_containing_pos (w, PT - delta, |
11693 |
first_unchanged_at_end_row, NULL); |
first_unchanged_at_end_row, NULL, 0); |
11694 |
if (row) |
if (row) |
11695 |
set_cursor_from_row (w, row, w->current_matrix, delta, |
set_cursor_from_row (w, row, w->current_matrix, delta, |
11696 |
delta_bytes, dy, dvpos); |
delta_bytes, dy, dvpos); |
12955 |
it->max_phys_ascent = phys_ascent; |
it->max_phys_ascent = phys_ascent; |
12956 |
it->max_phys_descent = phys_descent; |
it->max_phys_descent = phys_descent; |
12957 |
} |
} |
12958 |
|
else if (it->c == '\t' && FRAME_WINDOW_P (it->f)) |
12959 |
|
{ |
12960 |
|
/* A TAB that extends past the right edge of the |
12961 |
|
window. This produces a single glyph on |
12962 |
|
window system frames. We leave the glyph in |
12963 |
|
this row and let it fill the row, but don't |
12964 |
|
consume the TAB. */ |
12965 |
|
it->continuation_lines_width += it->last_visible_x; |
12966 |
|
row->ends_in_middle_of_char_p = 1; |
12967 |
|
row->continued_p = 1; |
12968 |
|
glyph->pixel_width = it->last_visible_x - x; |
12969 |
|
it->starts_in_middle_of_char_p = 1; |
12970 |
|
} |
12971 |
else |
else |
12972 |
{ |
{ |
12973 |
/* Display element draws past the right edge of |
/* Something other than a TAB that draws past |
12974 |
the window. Restore positions to values |
the right edge of the window. Restore |
12975 |
before the element. */ |
positions to values before the element. */ |
12976 |
row->used[TEXT_AREA] = n_glyphs_before + i; |
row->used[TEXT_AREA] = n_glyphs_before + i; |
12977 |
|
|
12978 |
/* Display continuation glyphs. */ |
/* Display continuation glyphs. */ |
12980 |
produce_special_glyphs (it, IT_CONTINUATION); |
produce_special_glyphs (it, IT_CONTINUATION); |
12981 |
row->continued_p = 1; |
row->continued_p = 1; |
12982 |
|
|
12983 |
/* A TAB takes us to the right edge of the window. */ |
it->continuation_lines_width += x; |
|
if (it->c == '\t') |
|
|
{ |
|
|
it->continuation_lines_width += it->last_visible_x; |
|
|
row->ends_in_middle_of_char_p = 1; |
|
|
} |
|
|
else |
|
|
it->continuation_lines_width += x; |
|
12984 |
|
|
12985 |
if (nglyphs > 1 && i > 0) |
if (nglyphs > 1 && i > 0) |
12986 |
{ |
{ |