diff options
| author | Eli Zaretskii | 2010-04-17 12:46:44 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-17 12:46:44 +0300 |
| commit | 8fccb1179b7e25ddd8f6b0ed74fadc7bb4940a3c (patch) | |
| tree | d53f368dfe4d571147bda495c743a5bc4960f933 /src | |
| parent | f951a50681995aa58a427f0be801c682df6e5baa (diff) | |
| download | emacs-8fccb1179b7e25ddd8f6b0ed74fadc7bb4940a3c.tar.gz emacs-8fccb1179b7e25ddd8f6b0ed74fadc7bb4940a3c.zip | |
Continue work on R2L paragraphs in GUI sessions.
xdisp.c (set_cursor_from_row): Don't be fooled by truncated
rows: don't treat them as having zero-width characters. Improve
comments.
(extend_face_to_end_of_line): Use window_box_width to compute the
width of the stretch glyph, to account for margins. If this is
the last glyph row, use DEFAULT_FACE_ID, to avoid painting the
rest of the window with the region face.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/xdisp.c | 42 |
2 files changed, 39 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e6faa0a4c9e..9625a1e8832 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2010-04-17 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | Continue work on R2L paragraphs in GUI sessions. | ||
| 4 | |||
| 5 | * xdisp.c (set_cursor_from_row): Don't be fooled by truncated | ||
| 6 | rows: don't treat them as having zero-width characters. Improve | ||
| 7 | comments. | ||
| 8 | (extend_face_to_end_of_line): Use window_box_width to compute the | ||
| 9 | width of the stretch glyph, to account for margins. If this is | ||
| 10 | the last glyph row, use DEFAULT_FACE_ID, to avoid painting the | ||
| 11 | rest of the window with the region face. | ||
| 12 | |||
| 1 | 2010-04-10 Eli Zaretskii <eliz@gnu.org> | 13 | 2010-04-10 Eli Zaretskii <eliz@gnu.org> |
| 2 | 14 | ||
| 3 | Implement display of R2L paragraphs in GUI sessions. | 15 | Implement display of R2L paragraphs in GUI sessions. |
diff --git a/src/xdisp.c b/src/xdisp.c index 1320b8a7380..f564ee6265a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12587,8 +12587,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12587 | } | 12587 | } |
| 12588 | while (end > glyph | 12588 | while (end > glyph |
| 12589 | && INTEGERP ((end - 1)->object) | 12589 | && INTEGERP ((end - 1)->object) |
| 12590 | /* CHARPOS is zero for blanks inserted by | 12590 | /* CHARPOS is zero for blanks and stretch glyphs |
| 12591 | extend_face_to_end_of_line. */ | 12591 | inserted by extend_face_to_end_of_line. */ |
| 12592 | && (end - 1)->charpos <= 0) | 12592 | && (end - 1)->charpos <= 0) |
| 12593 | --end; | 12593 | --end; |
| 12594 | glyph_before = glyph - 1; | 12594 | glyph_before = glyph - 1; |
| @@ -12810,7 +12810,10 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12810 | } | 12810 | } |
| 12811 | else if (match_with_avoid_cursor | 12811 | else if (match_with_avoid_cursor |
| 12812 | /* zero-width characters produce no glyphs */ | 12812 | /* zero-width characters produce no glyphs */ |
| 12813 | || eabs (glyph_after - glyph_before) == 1) | 12813 | || ((row->reversed_p |
| 12814 | ? glyph_after > glyphs_end | ||
| 12815 | : glyph_after < glyphs_end) | ||
| 12816 | && eabs (glyph_after - glyph_before) == 1)) | ||
| 12814 | { | 12817 | { |
| 12815 | cursor = glyph_after; | 12818 | cursor = glyph_after; |
| 12816 | x = -1; | 12819 | x = -1; |
| @@ -12929,11 +12932,17 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12929 | } | 12932 | } |
| 12930 | } | 12933 | } |
| 12931 | 12934 | ||
| 12932 | /* ROW could be part of a continued line, which might have other | 12935 | /* ROW could be part of a continued line, which, under bidi |
| 12933 | rows whose start and end charpos occlude point. Only set | 12936 | reordering, might have other rows whose start and end charpos |
| 12934 | w->cursor if we found a better approximation to the cursor | 12937 | occlude point. Only set w->cursor if we found a better |
| 12935 | position than we have from previously examined rows. */ | 12938 | approximation to the cursor position than we have from previously |
| 12936 | if (w->cursor.vpos >= 0 | 12939 | examined candidate rows belonging to the same continued line. */ |
| 12940 | if (/* we already have a candidate row */ | ||
| 12941 | w->cursor.vpos >= 0 | ||
| 12942 | /* that candidate is not the row we are processing */ | ||
| 12943 | && MATRIX_ROW (matrix, w->cursor.vpos) != row | ||
| 12944 | /* the row we are processing is part of a continued line */ | ||
| 12945 | && (row->continued_p || row->continuation_lines_width) | ||
| 12937 | /* Make sure cursor.vpos specifies a row whose start and end | 12946 | /* Make sure cursor.vpos specifies a row whose start and end |
| 12938 | charpos occlude point. This is because some callers of this | 12947 | charpos occlude point. This is because some callers of this |
| 12939 | function leave cursor.vpos at the row where the cursor was | 12948 | function leave cursor.vpos at the row where the cursor was |
| @@ -16849,21 +16858,24 @@ extend_face_to_end_of_line (it) | |||
| 16849 | 16858 | ||
| 16850 | for (row_width = 0, g = row_start; g < row_end; g++) | 16859 | for (row_width = 0, g = row_start; g < row_end; g++) |
| 16851 | row_width += g->pixel_width; | 16860 | row_width += g->pixel_width; |
| 16852 | stretch_width = WINDOW_BOX_RIGHT_EDGE_X(it->w) | 16861 | stretch_width = window_box_width (it->w, TEXT_AREA) - row_width; |
| 16853 | - WINDOW_BOX_LEFT_EDGE_X(it->w) | ||
| 16854 | - WINDOW_TOTAL_FRINGE_WIDTH(it->w) | ||
| 16855 | - row_width; | ||
| 16856 | if (stretch_width > 0) | 16862 | if (stretch_width > 0) |
| 16857 | { | 16863 | { |
| 16858 | stretch_ascent = | 16864 | stretch_ascent = |
| 16859 | (((it->ascent + it->descent) | 16865 | (((it->ascent + it->descent) |
| 16860 | * FONT_BASE (font)) / FONT_HEIGHT (font)); | 16866 | * FONT_BASE (font)) / FONT_HEIGHT (font)); |
| 16861 | saved_pos = it->position; | 16867 | saved_pos = it->position; |
| 16862 | saved_avoid_cursor = it->avoid_cursor_p; | ||
| 16863 | saved_face_id = it->face_id; | ||
| 16864 | bzero (&it->position, sizeof it->position); | 16868 | bzero (&it->position, sizeof it->position); |
| 16869 | saved_avoid_cursor = it->avoid_cursor_p; | ||
| 16865 | it->avoid_cursor_p = 1; | 16870 | it->avoid_cursor_p = 1; |
| 16866 | it->face_id = face->id; | 16871 | saved_face_id = it->face_id; |
| 16872 | /* The last row should get the default face, to avoid | ||
| 16873 | painting the rest of the window with the region face, | ||
| 16874 | if the region ends at ZV. */ | ||
| 16875 | if (it->glyph_row->ends_at_zv_p) | ||
| 16876 | it->face_id = DEFAULT_FACE_ID; | ||
| 16877 | else | ||
| 16878 | it->face_id = face->id; | ||
| 16867 | append_stretch_glyph (it, make_number (0), stretch_width, | 16879 | append_stretch_glyph (it, make_number (0), stretch_width, |
| 16868 | it->ascent + it->descent, stretch_ascent); | 16880 | it->ascent + it->descent, stretch_ascent); |
| 16869 | it->position = saved_pos; | 16881 | it->position = saved_pos; |