comparison src/syntax.c @ 23493:f8382c4e6551 v8.2.2289

patch 8.2.2289: Vim9: 'cpo' can become empty Commit: https://github.com/vim/vim/commit/e5a2dc87fd9d63dfd0d9c379e363ee8b8c05b14c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 3 19:52:05 2021 +0100 patch 8.2.2289: Vim9: 'cpo' can become empty Problem: Vim9: 'cpo' can become empty. Solution: Use empty_option instead of an empty string. Update quickfix buffer after restoring 'cpo'. (closes #7608)
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 Jan 2021 20:00:03 +0100
parents 6616bf17dc94
children d16a69f718b5
comparison
equal deleted inserted replaced
23492:27c9e319653b 23493:f8382c4e6551
5668 if ((ci->sp_pattern = vim_strnsave(arg + 1, end - arg - 1)) == NULL) 5668 if ((ci->sp_pattern = vim_strnsave(arg + 1, end - arg - 1)) == NULL)
5669 return NULL; 5669 return NULL;
5670 5670
5671 // Make 'cpoptions' empty, to avoid the 'l' flag 5671 // Make 'cpoptions' empty, to avoid the 'l' flag
5672 cpo_save = p_cpo; 5672 cpo_save = p_cpo;
5673 p_cpo = (char_u *)""; 5673 p_cpo = empty_option;
5674 ci->sp_prog = vim_regcomp(ci->sp_pattern, RE_MAGIC); 5674 ci->sp_prog = vim_regcomp(ci->sp_pattern, RE_MAGIC);
5675 p_cpo = cpo_save; 5675 p_cpo = cpo_save;
5676 5676
5677 if (ci->sp_prog == NULL) 5677 if (ci->sp_prog == NULL)
5678 return NULL; 5678 return NULL;
5856 } 5856 }
5857 curwin->w_s->b_syn_linecont_ic = curwin->w_s->b_syn_ic; 5857 curwin->w_s->b_syn_linecont_ic = curwin->w_s->b_syn_ic;
5858 5858
5859 // Make 'cpoptions' empty, to avoid the 'l' flag 5859 // Make 'cpoptions' empty, to avoid the 'l' flag
5860 cpo_save = p_cpo; 5860 cpo_save = p_cpo;
5861 p_cpo = (char_u *)""; 5861 p_cpo = empty_option;
5862 curwin->w_s->b_syn_linecont_prog = 5862 curwin->w_s->b_syn_linecont_prog =
5863 vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC); 5863 vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC);
5864 p_cpo = cpo_save; 5864 p_cpo = cpo_save;
5865 #ifdef FEAT_PROFILE 5865 #ifdef FEAT_PROFILE
5866 syn_clear_time(&curwin->w_s->b_syn_linecont_time); 5866 syn_clear_time(&curwin->w_s->b_syn_linecont_time);