summaryrefslogtreecommitdiff
path: root/src/bidi.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2011-06-09 17:39:27 +0300
committerEli Zaretskii <eliz@gnu.org>2011-06-09 17:39:27 +0300
commitbb269206f6ee49b68bb23cf955c531a7fc6ba140 (patch)
treead52055d982ccc8fd2d1a2ce17059d3df1bfefcb /src/bidi.c
parentd9334cb76854ba87934792b929d6ab68e70433ae (diff)
downloademacs-bb269206f6ee49b68bb23cf955c531a7fc6ba140.tar.gz
Add code to initialize bidi iterator for displaying strings.
For now, ifdef'ed away. Some more testing. src/bidi.c (bidi_level_of_next_char): Allow the sentinel "position" to pass the test for valid cached positions. src/xdisp.c (init_iterator): Call bidi_init_it only of a valid buffer position was specified. Initialize paragraph_embedding to L2R. (reseat_to_string): Initialize the bidi iterator (for now ifdef'ed out). (display_string): If we need to ignore text properties of LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The original value of -1 will not work with bidi.) src/dispextern.h (struct bidi_string_data): New member lstring.
Diffstat (limited to 'src/bidi.c')
-rw-r--r--src/bidi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bidi.c b/src/bidi.c
index ac950a9000a..a0a57b4c681 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1679,7 +1679,11 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
abort ();
next_char_pos = bidi_it->charpos + bidi_it->nchars;
}
- else if (bidi_it->charpos > (bidi_it->string.s ? 0 : 1))
+ else if (bidi_it->charpos >= (bidi_it->string.s ? 0 : 1))
+ /* Implementation note: we allow next_char_pos to be as low as
+ 0 for buffers or -1 for strings, and that is okay because
+ that's the "position" of the sentinel iterator state we
+ cached at the beginning of the iteration. */
next_char_pos = bidi_it->charpos - 1;
if (next_char_pos >= 0)
type = bidi_cache_find (next_char_pos, -1, bidi_it);