diff options
| author | Eli Zaretskii | 2016-08-11 18:11:26 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-08-11 18:11:26 +0300 |
| commit | d2db5dd8358f132252c8d11d40b1457615c43a57 (patch) | |
| tree | 3129334e5134ef35bbc4d74febd4e899d6613fcf /src | |
| parent | ccd0e92ecccba35d9a59ddf75b269d9eaa504e94 (diff) | |
| download | emacs-d2db5dd8358f132252c8d11d40b1457615c43a57.tar.gz emacs-d2db5dd8358f132252c8d11d40b1457615c43a57.zip | |
Fix bug with handling the bidi cache
* src/xdisp.c (redisplay_window): Save and restore the state of
the bidi cache before reusing the iterator after calls to
try_window and try_window_reusing_current_matrix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index cc2c951ce5c..24daa0c3b71 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -16122,6 +16122,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16122 | bool last_line_misfit = false; | 16122 | bool last_line_misfit = false; |
| 16123 | ptrdiff_t beg_unchanged, end_unchanged; | 16123 | ptrdiff_t beg_unchanged, end_unchanged; |
| 16124 | int frame_line_height; | 16124 | int frame_line_height; |
| 16125 | void *itdata = NULL; | ||
| 16125 | 16126 | ||
| 16126 | SET_TEXT_POS (lpoint, PT, PT_BYTE); | 16127 | SET_TEXT_POS (lpoint, PT, PT_BYTE); |
| 16127 | opoint = lpoint; | 16128 | opoint = lpoint; |
| @@ -16843,6 +16844,11 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16843 | /* Run scroll hooks. */ | 16844 | /* Run scroll hooks. */ |
| 16844 | startp = run_window_scroll_functions (window, it.current.pos); | 16845 | startp = run_window_scroll_functions (window, it.current.pos); |
| 16845 | 16846 | ||
| 16847 | /* We invoke try_window and try_window_reusing_current_matrix below, | ||
| 16848 | and they manipulate the bidi cache. Save and restore the cache | ||
| 16849 | state of our iterator, so we could continue using it after that. */ | ||
| 16850 | itdata = bidi_shelve_cache (); | ||
| 16851 | |||
| 16846 | /* Redisplay the window. */ | 16852 | /* Redisplay the window. */ |
| 16847 | bool use_desired_matrix = false; | 16853 | bool use_desired_matrix = false; |
| 16848 | if (!current_matrix_up_to_date_p | 16854 | if (!current_matrix_up_to_date_p |
| @@ -16857,6 +16863,8 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16857 | = try_window_reusing_current_matrix (w))) | 16863 | = try_window_reusing_current_matrix (w))) |
| 16858 | use_desired_matrix = (try_window (window, startp, 0) == 1); | 16864 | use_desired_matrix = (try_window (window, startp, 0) == 1); |
| 16859 | 16865 | ||
| 16866 | bidi_unshelve_cache (itdata, false); | ||
| 16867 | |||
| 16860 | /* If new fonts have been loaded (due to fontsets), give up. We | 16868 | /* If new fonts have been loaded (due to fontsets), give up. We |
| 16861 | have to start a new redisplay since we need to re-adjust glyph | 16869 | have to start a new redisplay since we need to re-adjust glyph |
| 16862 | matrices. */ | 16870 | matrices. */ |