Mercurial > vim
comparison src/screen.c @ 10769:dd93e5439ffd v8.0.0274
patch 8.0.0274: possible recursive screen updating causes trouble
commit https://github.com/vim/vim/commit/070b33da93ad3a191664bb61f5ccc50781460c03
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 31 21:53:39 2017 +0100
patch 8.0.0274: possible recursive screen updating causes trouble
Problem: When update_single_line() is called recursively, or another screen
update happens while it is busy, errors may occur.
Solution: Check and update updating_screen. (Christian Brabandt)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 31 Jan 2017 22:00:04 +0100 |
parents | 206ab11fa76e |
children | 4d34e72fe63d |
comparison
equal
deleted
inserted
replaced
10768:14c7e1c23ebb | 10769:dd93e5439ffd |
---|---|
822 { | 822 { |
823 int row; | 823 int row; |
824 int j; | 824 int j; |
825 | 825 |
826 /* Don't do anything if the screen structures are (not yet) valid. */ | 826 /* Don't do anything if the screen structures are (not yet) valid. */ |
827 if (!screen_valid(TRUE)) | 827 if (!screen_valid(TRUE) || updating_screen) |
828 return; | 828 return; |
829 updating_screen = TRUE; | |
829 | 830 |
830 if (lnum >= wp->w_topline && lnum < wp->w_botline | 831 if (lnum >= wp->w_topline && lnum < wp->w_botline |
831 && foldedCount(wp, lnum, &win_foldinfo) == 0) | 832 && foldedCount(wp, lnum, &win_foldinfo) == 0) |
832 { | 833 { |
833 # ifdef FEAT_GUI | 834 # ifdef FEAT_GUI |
863 gui_update_cursor(FALSE, FALSE); | 864 gui_update_cursor(FALSE, FALSE); |
864 } | 865 } |
865 # endif | 866 # endif |
866 } | 867 } |
867 need_cursor_line_redraw = FALSE; | 868 need_cursor_line_redraw = FALSE; |
869 updating_screen = FALSE; | |
868 } | 870 } |
869 #endif | 871 #endif |
870 | 872 |
871 #if defined(FEAT_SIGNS) || defined(FEAT_GUI) | 873 #if defined(FEAT_SIGNS) || defined(FEAT_GUI) |
872 static void update_prepare(void); | |
873 static void update_finish(void); | |
874 | |
875 /* | 874 /* |
876 * Prepare for updating one or more windows. | 875 * Prepare for updating one or more windows. |
877 * Caller must check for "updating_screen" already set to avoid recursiveness. | 876 * Caller must check for "updating_screen" already set to avoid recursiveness. |
878 */ | 877 */ |
879 static void | 878 static void |