summaryrefslogtreecommitdiff
path: root/src/bidi.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-06-08 21:28:36 +0300
committerEli Zaretskii <eliz@gnu.org>2013-06-08 21:28:36 +0300
commit5bf97bfc6730fa2a4ca187cadbb689d79178eafc (patch)
treec9d5b7044991216bc3b8e5b50a49ba66537d245d /src/bidi.c
parentb33f93eea9ddf94aaa4c48b9c057a58b8fa2b6c9 (diff)
downloademacs-5bf97bfc6730fa2a4ca187cadbb689d79178eafc.tar.gz
Fix bug #14575 with window-specific overlays with display props.
src/bidi.c (bidi_fetch_char): Accept additional argument, the window being displayed, and pass it to compute_display_string_pos. (bidi_level_of_next_char, bidi_resolve_explicit_1) (bidi_paragraph_init): All callers changed. src/xdisp.c (init_from_display_pos, init_iterator) (handle_single_display_spec, next_overlay_string) (get_overlay_strings_1, reseat_1, reseat_to_string) (push_prefix_prop, Fcurrent_bidi_paragraph_direction): Set bidi_it.w member from it->w. (compute_display_string_pos): Accept additional argument, the window being displayed, and pass it to Fget_char_property. src/dispextern.h (struct bidi_it): New member w, the window being displayed. (compute_display_string_pos): Adjust prototype.
Diffstat (limited to 'src/bidi.c')
-rw-r--r--src/bidi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bidi.c b/src/bidi.c
index c6bea62f67b..c31d208ecbc 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -927,6 +927,7 @@ bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte)
static int
bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos,
int *disp_prop, struct bidi_string_data *string,
+ struct window *w,
bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars)
{
int ch;
@@ -940,7 +941,7 @@ bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos,
if (charpos < endpos && charpos > *disp_pos)
{
SET_TEXT_POS (pos, charpos, bytepos);
- *disp_pos = compute_display_string_pos (&pos, string, frame_window_p,
+ *disp_pos = compute_display_string_pos (&pos, string, w, frame_window_p,
disp_prop);
}
@@ -1045,7 +1046,7 @@ bidi_fetch_char (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t *disp_pos,
&& *disp_prop)
{
SET_TEXT_POS (pos, charpos + *nchars, bytepos + *ch_len);
- *disp_pos = compute_display_string_pos (&pos, string, frame_window_p,
+ *disp_pos = compute_display_string_pos (&pos, string, w, frame_window_p,
disp_prop);
}
@@ -1224,7 +1225,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, bool no_default_p)
if (!string_p)
pos = BYTE_TO_CHAR (bytepos);
ch = bidi_fetch_char (pos, bytepos, &disp_pos, &disp_prop,
- &bidi_it->string,
+ &bidi_it->string, bidi_it->w,
bidi_it->frame_window_p, &ch_len, &nchars);
type = bidi_get_type (ch, NEUTRAL_DIR);
@@ -1252,7 +1253,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, bool no_default_p)
break;
/* Fetch next character and advance to get past it. */
ch = bidi_fetch_char (pos, bytepos, &disp_pos,
- &disp_prop, &bidi_it->string,
+ &disp_prop, &bidi_it->string, bidi_it->w,
bidi_it->frame_window_p, &ch_len, &nchars);
pos += nchars;
bytepos += ch_len;
@@ -1402,7 +1403,8 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it)
a single character u+FFFC. */
curchar = bidi_fetch_char (bidi_it->charpos, bidi_it->bytepos,
&bidi_it->disp_pos, &bidi_it->disp_prop,
- &bidi_it->string, bidi_it->frame_window_p,
+ &bidi_it->string, bidi_it->w,
+ bidi_it->frame_window_p,
&bidi_it->ch_len, &bidi_it->nchars);
}
bidi_it->ch = curchar;
@@ -2194,7 +2196,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
emacs_abort ();
do {
ch = bidi_fetch_char (cpos += nc, bpos += clen, &disp_pos, &dpp, &bs,
- fwp, &clen, &nc);
+ bidi_it->w, fwp, &clen, &nc);
if (ch == '\n' || ch == BIDI_EOB)
chtype = NEUTRAL_B;
else