diff options
| author | Eli Zaretskii | 2011-08-19 13:18:40 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-08-19 13:18:40 +0300 |
| commit | 54a1215bccc20584285799c015a81f668b266bbc (patch) | |
| tree | c870777f750687615733292d31f31be2c1fa2a88 /src | |
| parent | f08670270206439ed672793573159c611a6f1379 (diff) | |
| download | emacs-54a1215bccc20584285799c015a81f668b266bbc.tar.gz emacs-54a1215bccc20584285799c015a81f668b266bbc.zip | |
Fix bidi cursor motion when a line begins with a composed character.
src/xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
a composition, take its buffer position from IT->cmp_it.charpos.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 19 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2b5b6fd0602..b5474fcc55b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-08-19 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from | ||
| 4 | a composition, take its buffer position from IT->cmp_it.charpos. | ||
| 5 | Fixes cursor positioning at the beginning of a line that begins | ||
| 6 | with a composed character. | ||
| 7 | |||
| 1 | 2011-08-18 Eli Zaretskii <eliz@gnu.org> | 8 | 2011-08-18 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * bidi.c (bidi_get_type): If bidi_type_table reports zero as the | 10 | * bidi.c (bidi_get_type): If bidi_type_table reports zero as the |
diff --git a/src/xdisp.c b/src/xdisp.c index ea98ac575d9..e773830800e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -18386,15 +18386,22 @@ display_line (struct it *it) | |||
| 18386 | #define RECORD_MAX_MIN_POS(IT) \ | 18386 | #define RECORD_MAX_MIN_POS(IT) \ |
| 18387 | do \ | 18387 | do \ |
| 18388 | { \ | 18388 | { \ |
| 18389 | if (IT_CHARPOS (*(IT)) < min_pos) \ | 18389 | int composition_p = (IT)->what == IT_COMPOSITION; \ |
| 18390 | EMACS_INT current_pos = \ | ||
| 18391 | composition_p ? (IT)->cmp_it.charpos \ | ||
| 18392 | : IT_CHARPOS (*(IT)); \ | ||
| 18393 | EMACS_INT current_bpos = \ | ||
| 18394 | composition_p ? CHAR_TO_BYTE (current_pos) \ | ||
| 18395 | : IT_BYTEPOS (*(IT)); \ | ||
| 18396 | if (current_pos < min_pos) \ | ||
| 18390 | { \ | 18397 | { \ |
| 18391 | min_pos = IT_CHARPOS (*(IT)); \ | 18398 | min_pos = current_pos; \ |
| 18392 | min_bpos = IT_BYTEPOS (*(IT)); \ | 18399 | min_bpos = current_bpos; \ |
| 18393 | } \ | 18400 | } \ |
| 18394 | if (IT_CHARPOS (*(IT)) > max_pos) \ | 18401 | if (current_pos > max_pos) \ |
| 18395 | { \ | 18402 | { \ |
| 18396 | max_pos = IT_CHARPOS (*(IT)); \ | 18403 | max_pos = current_pos; \ |
| 18397 | max_bpos = IT_BYTEPOS (*(IT)); \ | 18404 | max_bpos = current_bpos; \ |
| 18398 | } \ | 18405 | } \ |
| 18399 | } \ | 18406 | } \ |
| 18400 | while (0) | 18407 | while (0) |