diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 21fc01f1e69..a8376af978f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -16188,6 +16188,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16188 | ptrdiff_t beg_unchanged, end_unchanged; | 16188 | ptrdiff_t beg_unchanged, end_unchanged; |
| 16189 | int frame_line_height; | 16189 | int frame_line_height; |
| 16190 | bool use_desired_matrix; | 16190 | bool use_desired_matrix; |
| 16191 | void *itdata = NULL; | ||
| 16191 | 16192 | ||
| 16192 | SET_TEXT_POS (lpoint, PT, PT_BYTE); | 16193 | SET_TEXT_POS (lpoint, PT, PT_BYTE); |
| 16193 | opoint = lpoint; | 16194 | opoint = lpoint; |
| @@ -16909,6 +16910,11 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16909 | /* Run scroll hooks. */ | 16910 | /* Run scroll hooks. */ |
| 16910 | startp = run_window_scroll_functions (window, it.current.pos); | 16911 | startp = run_window_scroll_functions (window, it.current.pos); |
| 16911 | 16912 | ||
| 16913 | /* We invoke try_window and try_window_reusing_current_matrix below, | ||
| 16914 | and they manipulate the bidi cache. Save and restore the cache | ||
| 16915 | state of our iterator, so we could continue using it after that. */ | ||
| 16916 | itdata = bidi_shelve_cache (); | ||
| 16917 | |||
| 16912 | /* Redisplay the window. */ | 16918 | /* Redisplay the window. */ |
| 16913 | use_desired_matrix = false; | 16919 | use_desired_matrix = false; |
| 16914 | if (!current_matrix_up_to_date_p | 16920 | if (!current_matrix_up_to_date_p |
| @@ -16923,6 +16929,8 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16923 | = try_window_reusing_current_matrix (w))) | 16929 | = try_window_reusing_current_matrix (w))) |
| 16924 | use_desired_matrix = (try_window (window, startp, 0) == 1); | 16930 | use_desired_matrix = (try_window (window, startp, 0) == 1); |
| 16925 | 16931 | ||
| 16932 | bidi_unshelve_cache (itdata, false); | ||
| 16933 | |||
| 16926 | /* If new fonts have been loaded (due to fontsets), give up. We | 16934 | /* If new fonts have been loaded (due to fontsets), give up. We |
| 16927 | have to start a new redisplay since we need to re-adjust glyph | 16935 | have to start a new redisplay since we need to re-adjust glyph |
| 16928 | matrices. */ | 16936 | matrices. */ |
| @@ -16948,6 +16956,26 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16948 | move_it_by_lines (&it, -1); | 16956 | move_it_by_lines (&it, -1); |
| 16949 | try_window (window, it.current.pos, 0); | 16957 | try_window (window, it.current.pos, 0); |
| 16950 | } | 16958 | } |
| 16959 | else if (scroll_conservatively > SCROLL_LIMIT | ||
| 16960 | && it.method == GET_FROM_STRING | ||
| 16961 | && IT_CHARPOS (it) < ZV) | ||
| 16962 | { | ||
| 16963 | /* If the window starts with a before-string that spans more | ||
| 16964 | than one screen line, using that position to display the | ||
| 16965 | window might fail to bring point into the view, because | ||
| 16966 | start_display will always start by displaying the string, | ||
| 16967 | whereas the code above determines where to set w->start | ||
| 16968 | by the buffer position of the place where it takes screen | ||
| 16969 | coordinates. Try to recover by finding the next screen | ||
| 16970 | line that displays buffer text. */ | ||
| 16971 | ptrdiff_t pos0 = IT_CHARPOS (it); | ||
| 16972 | |||
| 16973 | clear_glyph_matrix (w->desired_matrix); | ||
| 16974 | do { | ||
| 16975 | move_it_by_lines (&it, 1); | ||
| 16976 | } while (IT_CHARPOS (it) == pos0 && it.method == GET_FROM_STRING); | ||
| 16977 | try_window (window, it.current.pos, 0); | ||
| 16978 | } | ||
| 16951 | else | 16979 | else |
| 16952 | { | 16980 | { |
| 16953 | /* Not much we can do about it. */ | 16981 | /* Not much we can do about it. */ |