Commit 425cc014 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix crashes with completion and composed characters.

 src/dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
 instead of CHAR_TO_BYTE.  Fixes a crash when a completion
 candidate is selected by the mouse, and that candidate has a
 composed character under the mouse.
parent 1a2e6670
2011-08-23 Eli Zaretskii <eliz@gnu.org>
* dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
instead of CHAR_TO_BYTE. Fixes a crash when a completion
candidate is selected by the mouse, and that candidate has a
composed character under the mouse.
* xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
coordinates reported by pos-visible-in-window-p for a composed
character in column zero.
......
......@@ -5307,7 +5307,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
if (STRINGP (it.string))
BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos));
else
BYTEPOS (pos->pos) = CHAR_TO_BYTE (CHARPOS (pos->pos));
BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer),
CHARPOS (pos->pos));
}
#ifdef HAVE_WINDOW_SYSTEM
......
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