comparison src/screen.c @ 16835:7cade95272c4 v8.1.1419

patch 8.1.1419: listener callbacks may be called recursively commit https://github.com/vim/vim/commit/68a4b04a8d2471adf9de595745437c7cf20b98d8 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 29 22:28:29 2019 +0200 patch 8.1.1419: listener callbacks may be called recursively Problem: Listener callbacks may be called recursively. Solution: Set "updating_screen" while listener callbacks are invoked.
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 May 2019 22:30:06 +0200
parents ce04ebdf26b8
children 032d5335987e
comparison
equal deleted inserted replaced
16834:d8da28aef349 16835:7cade95272c4
504 if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) 504 if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
505 wp->w_redraw_bot = lnum; 505 wp->w_redraw_bot = lnum;
506 redraw_win_later(wp, VALID); 506 redraw_win_later(wp, VALID);
507 } 507 }
508 508
509 /*
510 * To be called when "updating_screen" was set before and now the postponed
511 * side effects may take place.
512 */
509 void 513 void
510 reset_updating_screen(int may_resize_shell UNUSED) 514 after_updating_screen(int may_resize_shell UNUSED)
511 { 515 {
512 updating_screen = FALSE; 516 updating_screen = FALSE;
513 #ifdef FEAT_GUI 517 #ifdef FEAT_GUI
514 if (may_resize_shell) 518 if (may_resize_shell)
515 gui_may_resize_shell(); 519 gui_may_resize_shell();
801 /* Reset b_mod_set flags. Going through all windows is probably faster 805 /* Reset b_mod_set flags. Going through all windows is probably faster
802 * than going through all buffers (there could be many buffers). */ 806 * than going through all buffers (there could be many buffers). */
803 FOR_ALL_WINDOWS(wp) 807 FOR_ALL_WINDOWS(wp)
804 wp->w_buffer->b_mod_set = FALSE; 808 wp->w_buffer->b_mod_set = FALSE;
805 809
806 reset_updating_screen(TRUE); 810 after_updating_screen(TRUE);
807 811
808 /* Clear or redraw the command line. Done last, because scrolling may 812 /* Clear or redraw the command line. Done last, because scrolling may
809 * mess up the command line. */ 813 * mess up the command line. */
810 if (clear_cmdline || redraw_cmdline || redraw_mode) 814 if (clear_cmdline || redraw_cmdline || redraw_mode)
811 showmode(); 815 showmode();
884 888
885 # ifdef FEAT_SEARCH_EXTRA 889 # ifdef FEAT_SEARCH_EXTRA
886 end_search_hl(); 890 end_search_hl();
887 # endif 891 # endif
888 892
889 reset_updating_screen(TRUE); 893 after_updating_screen(TRUE);
890 894
891 # ifdef FEAT_GUI 895 # ifdef FEAT_GUI
892 /* Redraw the cursor and update the scrollbars when all screen updating is 896 /* Redraw the cursor and update the scrollbars when all screen updating is
893 * done. */ 897 * done. */
894 if (gui.in_use) 898 if (gui.in_use)