comparison src/xdisp.c @ 107600:e47593843838

Retrospective commit from 2009-10-31. Continue debugging set_cursor_from_row. Continue debugging display of R2L glyph rows. xdisp.c (display_line): Always extend reversed_p rows to the end of line. (set_cursor_from_row): In R2L rows that don't display text, put the cursor on the rightmost glyph.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 01 Jan 2010 06:49:38 -0500
parents 23f8a579b56e
children d44bdcba4457
comparison
equal deleted inserted replaced
107599:23f8a579b56e 107600:e47593843838
6573 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); 6573 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
6574 /* If the paragraph base direction is R2L, its glyphs should 6574 /* If the paragraph base direction is R2L, its glyphs should
6575 be reversed. */ 6575 be reversed. */
6576 if (it->glyph_row && (it->bidi_it.level_stack[0].level & 1) != 0) 6576 if (it->glyph_row && (it->bidi_it.level_stack[0].level & 1) != 0)
6577 it->glyph_row->reversed_p = 1; 6577 it->glyph_row->reversed_p = 1;
6578 if (it->glyph_row && (it->bidi_it.level_stack[0].level & 1) != 0)
6579 it->glyph_row->reversed_p = 1;
6580 bidi_get_next_char_visually (&it->bidi_it); 6578 bidi_get_next_char_visually (&it->bidi_it);
6581 } 6579 }
6582 else 6580 else
6583 { 6581 {
6584 int orig_bytepos = IT_BYTEPOS (*it); 6582 int orig_bytepos = IT_BYTEPOS (*it);
12524 && (end + 1)->charpos <= 0) 12522 && (end + 1)->charpos <= 0)
12525 ++end; 12523 ++end;
12526 glyph_before = glyph + 1; 12524 glyph_before = glyph + 1;
12527 glyph_after = end; 12525 glyph_after = end;
12528 } 12526 }
12527 }
12528 else if (row->reversed_p)
12529 {
12530 /* In R2L rows that don't display text, put the cursor on the
12531 rightmost glyph. Case in point: an empty last line that is
12532 part of an R2L paragraph. */
12533 cursor = end - 1;
12534 x = -1; /* will be computed below, at lable compute_x */
12529 } 12535 }
12530 12536
12531 /* Step 1: Try to find the glyph whose character position 12537 /* Step 1: Try to find the glyph whose character position
12532 corresponds to point. If that's not possible, find 2 glyphs 12538 corresponds to point. If that's not possible, find 2 glyphs
12533 whose character positions are the closest to point, one before 12539 whose character positions are the closest to point, one before
12699 int gpos = glyph->charpos; 12705 int gpos = glyph->charpos;
12700 12706
12701 cprop = Fget_char_property (make_number (gpos), 12707 cprop = Fget_char_property (make_number (gpos),
12702 Qcursor, 12708 Qcursor,
12703 glyph->object); 12709 glyph->object);
12710 /* FIXME: This loses the feature of the
12711 unidirectional redisplay when the
12712 property value was an integer. */
12704 if (!NILP (cprop)) 12713 if (!NILP (cprop))
12705 { 12714 {
12706 cursor = glyph; 12715 cursor = glyph;
12707 break; 12716 break;
12708 } 12717 }
16527 int saved_x = it->current_x; 16536 int saved_x = it->current_x;
16528 struct text_pos saved_pos; 16537 struct text_pos saved_pos;
16529 Lisp_Object saved_object; 16538 Lisp_Object saved_object;
16530 enum display_element_type saved_what = it->what; 16539 enum display_element_type saved_what = it->what;
16531 int saved_face_id = it->face_id; 16540 int saved_face_id = it->face_id;
16532 int text_len = it->glyph_row->used[TEXT_AREA];
16533 16541
16534 saved_object = it->object; 16542 saved_object = it->object;
16535 saved_pos = it->position; 16543 saved_pos = it->position;
16536 16544
16537 it->what = IT_CHARACTER; 16545 it->what = IT_CHARACTER;
16903 row->indicate_empty_line_p = 1; 16911 row->indicate_empty_line_p = 1;
16904 } 16912 }
16905 16913
16906 it->continuation_lines_width = 0; 16914 it->continuation_lines_width = 0;
16907 row->ends_at_zv_p = 1; 16915 row->ends_at_zv_p = 1;
16916 /* A row that displays right-to-left text must always have
16917 its last face extended all the way to the end of line,
16918 even if this row ends in ZV. */
16919 if (row->reversed_p)
16920 extend_face_to_end_of_line (it);
16908 row_end = it->current; 16921 row_end = it->current;
16909 break; 16922 break;
16910 } 16923 }
16911 16924
16912 /* Now, get the metrics of what we want to display. This also 16925 /* Now, get the metrics of what we want to display. This also