comparison src/insexpand.c @ 32479:87f59a64efab v9.0.1571

patch 9.0.1571: RedrawingDisabled not used consistently Commit: https://github.com/vim/vim/commit/79cdf026f1b8a16298ee73be497c4bd5f3458cde Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 20 14:07:00 2023 +0100 patch 9.0.1571: RedrawingDisabled not used consistently Problem: RedrawingDisabled not used consistently. Solution: Avoid RedrawingDisabled going negative. Set RedrawingDisabled in win_split_ins(). (closes #11961)
author Bram Moolenaar <Bram@vim.org>
date Sat, 20 May 2023 15:15:05 +0200
parents bea4ebf594c6
children 448aef880252
comparison
equal deleted inserted replaced
32478:8117806f2947 32479:87f59a64efab
2967 * "complete_check()" function 2967 * "complete_check()" function
2968 */ 2968 */
2969 void 2969 void
2970 f_complete_check(typval_T *argvars UNUSED, typval_T *rettv) 2970 f_complete_check(typval_T *argvars UNUSED, typval_T *rettv)
2971 { 2971 {
2972 int saved = RedrawingDisabled; 2972 int save_RedrawingDisabled = RedrawingDisabled;
2973
2974 RedrawingDisabled = 0; 2973 RedrawingDisabled = 0;
2974
2975 ins_compl_check_keys(0, TRUE); 2975 ins_compl_check_keys(0, TRUE);
2976 rettv->vval.v_number = ins_compl_interrupted(); 2976 rettv->vval.v_number = ins_compl_interrupted();
2977 RedrawingDisabled = saved; 2977
2978 RedrawingDisabled = save_RedrawingDisabled;
2978 } 2979 }
2979 2980
2980 /* 2981 /*
2981 * Return Insert completion mode name string 2982 * Return Insert completion mode name string
2982 */ 2983 */
5077 */ 5078 */
5078 static void 5079 static void
5079 show_pum(int prev_w_wrow, int prev_w_leftcol) 5080 show_pum(int prev_w_wrow, int prev_w_leftcol)
5080 { 5081 {
5081 // RedrawingDisabled may be set when invoked through complete(). 5082 // RedrawingDisabled may be set when invoked through complete().
5082 int n = RedrawingDisabled; 5083 int save_RedrawingDisabled = RedrawingDisabled;
5083
5084 RedrawingDisabled = 0; 5084 RedrawingDisabled = 0;
5085 5085
5086 // If the cursor moved or the display scrolled we need to remove the pum 5086 // If the cursor moved or the display scrolled we need to remove the pum
5087 // first. 5087 // first.
5088 setcursor(); 5088 setcursor();
5089 if (prev_w_wrow != curwin->w_wrow || prev_w_leftcol != curwin->w_leftcol) 5089 if (prev_w_wrow != curwin->w_wrow || prev_w_leftcol != curwin->w_leftcol)
5090 ins_compl_del_pum(); 5090 ins_compl_del_pum();
5091 5091
5092 ins_compl_show_pum(); 5092 ins_compl_show_pum();
5093 setcursor(); 5093 setcursor();
5094 RedrawingDisabled = n; 5094
5095 RedrawingDisabled = save_RedrawingDisabled;
5095 } 5096 }
5096 5097
5097 /* 5098 /*
5098 * Looks in the first "len" chars. of "src" for search-metachars. 5099 * Looks in the first "len" chars. of "src" for search-metachars.
5099 * If dest is not NULL the chars. are copied there quoting (with 5100 * If dest is not NULL the chars. are copied there quoting (with