Commit c0546589 authored by Eli Zaretskii's avatar Eli Zaretskii

Fix glyph_row reversed_p flag in empty lines between paragraphs.

 bidi.c (bidi_get_next_char_visually): Improve commentary.
 dispextern.h (PRODUCE_GLYPHS): Set the reversed_p flag in the
 iterator's glyph_row here.
 xdisp.c (handle_invisible_prop, set_iterator_to_next)
 (next_element_from_buffer): Don't set the reversed_p flag in the
 iterator's glyph_row here.
parent e7dbdb6d
2010-03-28 Eli Zaretskii <eliz@gnu.org>
* bidi.c (bidi_get_next_char_visually): Improve commentary.
* dispextern.h (PRODUCE_GLYPHS): Set the reversed_p flag in the
iterator's glyph_row here.
* xdisp.c (handle_invisible_prop, set_iterator_to_next)
(next_element_from_buffer): Don't set the reversed_p flag in the
iterator's glyph_row here.
2010-03-20 Eli Zaretskii <eliz@gnu.org> 2010-03-20 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (set_cursor_from_row): Don't miss a candidate row whose * xdisp.c (set_cursor_from_row): Don't miss a candidate row whose
......
...@@ -1901,7 +1901,7 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it) ...@@ -1901,7 +1901,7 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it)
/* Reordering of resolved levels (clause L2) is implemented by /* Reordering of resolved levels (clause L2) is implemented by
jumping to the other edge of the level and flipping direction of jumping to the other edge of the level and flipping direction of
scanning the buffer whenever we find a level change. */ scanning the text whenever we find a level change. */
if (new_level != old_level) if (new_level != old_level)
{ {
int ascending = new_level > old_level; int ascending = new_level > old_level;
...@@ -1959,7 +1959,9 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it) ...@@ -1959,7 +1959,9 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it)
paragraph direction, if needed. We do this at the newline before paragraph direction, if needed. We do this at the newline before
the paragraph separator, because the next character might not be the paragraph separator, because the next character might not be
the first character of the next paragraph, due to the bidi the first character of the next paragraph, due to the bidi
reordering. */ reordering, whereas we _must_ know the paragraph base direction
_before_ we process the paragraph's text, since the base
direction affects the reordering. */
if (bidi_it->scan_dir == 1 if (bidi_it->scan_dir == 1
&& bidi_it->orig_type == NEUTRAL_B && bidi_it->orig_type == NEUTRAL_B
&& bidi_it->bytepos < ZV_BYTE) && bidi_it->bytepos < ZV_BYTE)
......
...@@ -2399,6 +2399,13 @@ struct it ...@@ -2399,6 +2399,13 @@ struct it
#define PRODUCE_GLYPHS(IT) \ #define PRODUCE_GLYPHS(IT) \
do { \ do { \
extern int inhibit_free_realized_faces; \ extern int inhibit_free_realized_faces; \
if ((IT)->glyph_row != NULL && (IT)->bidi_p) \
{ \
if ((IT)->bidi_it.paragraph_dir == R2L) \
(IT)->glyph_row->reversed_p = 1; \
else \
(IT)->glyph_row->reversed_p = 0; \
} \
if (FRAME_RIF ((IT)->f) != NULL) \ if (FRAME_RIF ((IT)->f) != NULL) \
FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \ FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \
else \ else \
......
...@@ -3869,15 +3869,6 @@ handle_invisible_prop (it) ...@@ -3869,15 +3869,6 @@ handle_invisible_prop (it)
skip any text at the beginning, which resets the skip any text at the beginning, which resets the
FIRST_ELT flag. */ FIRST_ELT flag. */
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
/* If the paragraph base direction is R2L, its
glyphs should be reversed. */
if (it->glyph_row)
{
if (it->bidi_it.paragraph_dir == R2L)
it->glyph_row->reversed_p = 1;
else
it->glyph_row->reversed_p = 0;
}
} }
do do
{ {
...@@ -6235,16 +6226,7 @@ set_iterator_to_next (it, reseat_p) ...@@ -6235,16 +6226,7 @@ set_iterator_to_next (it, reseat_p)
/* If this is a new paragraph, determine its base /* If this is a new paragraph, determine its base
direction (a.k.a. its base embedding level). */ direction (a.k.a. its base embedding level). */
if (it->bidi_it.new_paragraph) if (it->bidi_it.new_paragraph)
{ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
if (it->glyph_row)
{
if (it->bidi_it.paragraph_dir == R2L)
it->glyph_row->reversed_p = 1;
else
it->glyph_row->reversed_p = 0;
}
}
bidi_get_next_char_visually (&it->bidi_it); bidi_get_next_char_visually (&it->bidi_it);
IT_BYTEPOS (*it) = it->bidi_it.bytepos; IT_BYTEPOS (*it) = it->bidi_it.bytepos;
IT_CHARPOS (*it) = it->bidi_it.charpos; IT_CHARPOS (*it) = it->bidi_it.charpos;
...@@ -6705,15 +6687,6 @@ next_element_from_buffer (it) ...@@ -6705,15 +6687,6 @@ next_element_from_buffer (it)
|| FETCH_CHAR (it->bidi_it.bytepos) == '\n') || FETCH_CHAR (it->bidi_it.bytepos) == '\n')
{ {
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
/* If the paragraph base direction is R2L, its glyphs should
be reversed. */
if (it->glyph_row)
{
if (it->bidi_it.paragraph_dir == R2L)
it->glyph_row->reversed_p = 1;
else
it->glyph_row->reversed_p = 0;
}
bidi_get_next_char_visually (&it->bidi_it); bidi_get_next_char_visually (&it->bidi_it);
} }
else else
...@@ -6728,13 +6701,6 @@ next_element_from_buffer (it) ...@@ -6728,13 +6701,6 @@ next_element_from_buffer (it)
it->bidi_it.charpos = IT_CHARPOS (*it); it->bidi_it.charpos = IT_CHARPOS (*it);
it->bidi_it.bytepos = IT_BYTEPOS (*it); it->bidi_it.bytepos = IT_BYTEPOS (*it);
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it); bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
if (it->glyph_row)
{
if (it->bidi_it.paragraph_dir == R2L)
it->glyph_row->reversed_p = 1;
else
it->glyph_row->reversed_p = 0;
}
do do
{ {
/* Now return to buffer position where we were asked to /* Now return to buffer position where we were asked to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment