X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/1abfd3e85fa9b340699430cd9e15dd9f0073bdbe..a611149e46d0a6927e9c276d4cf2089b7cfb7e05:/src/bidi.c diff --git a/src/bidi.c b/src/bidi.c index 364d7e500b..cf5e580cd8 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1108,7 +1108,7 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) display string? And what if a display string covering some of the text over which we scan back includes paragraph_start_re? */ - pos = find_next_newline_no_quit (pos - 1, -1, &pos_byte); + pos = find_newline_no_quit (pos - 1, -1, &pos_byte); if (n >= MAX_PARAGRAPH_SEARCH) pos_byte = BEGV_BYTE; return pos_byte; @@ -1353,15 +1353,19 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it) : bidi_it->string.s); if (bidi_it->charpos < 0) - bidi_it->charpos = 0; - bidi_it->bytepos = bidi_count_bytes (p, 0, 0, bidi_it->charpos, - bidi_it->string.unibyte); + bidi_it->charpos = bidi_it->bytepos = 0; + eassert (bidi_it->bytepos == bidi_count_bytes (p, 0, 0, + bidi_it->charpos, + bidi_it->string.unibyte)); } else { if (bidi_it->charpos < BEGV) - bidi_it->charpos = BEGV; - bidi_it->bytepos = CHAR_TO_BYTE (bidi_it->charpos); + { + bidi_it->charpos = BEGV; + bidi_it->bytepos = BEGV_BYTE; + } + eassert (bidi_it->bytepos == CHAR_TO_BYTE (bidi_it->charpos)); } } /* Don't move at end of buffer/string. */