summaryrefslogtreecommitdiff
path: root/src/quickfix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-03 19:52:05 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-03 19:52:05 +0100
commite5a2dc87fd9d63dfd0d9c379e363ee8b8c05b14c (patch)
tree715a114546d458acfe85c5d0fe94fed963842ce9 /src/quickfix.c
parent5afd081cd3d0f3dfbc7f6b157a8caad0ce6394ee (diff)
downloadvim-git-e5a2dc87fd9d63dfd0d9c379e363ee8b8c05b14c.tar.gz
patch 8.2.2289: Vim9: 'cpo' can become emptyv8.2.2289
Problem: Vim9: 'cpo' can become empty. Solution: Use empty_option instead of an empty string. Update quickfix buffer after restoring 'cpo'. (closes #7608)
Diffstat (limited to 'src/quickfix.c')
-rw-r--r--src/quickfix.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index 697a3d422..f22d2bf3c 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -8099,6 +8099,7 @@ ex_helpgrep(exarg_T *eap)
int new_qi = FALSE;
char_u *au_name = NULL;
char_u *lang = NULL;
+ int updated = FALSE;
switch (eap->cmdidx)
{
@@ -8150,14 +8151,24 @@ ex_helpgrep(exarg_T *eap)
qfl->qf_ptr = qfl->qf_start;
qfl->qf_index = 1;
qf_list_changed(qfl);
- qf_update_buffer(qi, NULL);
+ updated = TRUE;
}
if (p_cpo == empty_option)
p_cpo = save_cpo;
else
- // Darn, some plugin changed the value.
+ {
+ // Darn, some plugin changed the value. If it's still empty it was
+ // changed and restored, need to restore in the complicated way.
+ if (*p_cpo == NUL)
+ set_option_value((char_u *)"cpo", 0L, save_cpo, 0);
free_string_option(save_cpo);
+ }
+
+ if (updated)
+ // This may open a window and source scripts, do this after 'cpo' was
+ // restored.
+ qf_update_buffer(qi, NULL);
if (au_name != NULL)
{