fix(inccommand): parse the command to check if it is previewable

Free regprog if command isn't previewable

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
Famiu Haque
2022-06-28 11:00:05 +06:00
committed by GitHub
parent 274609a109
commit 7e1cf6b764
4 changed files with 34 additions and 50 deletions

View File

@@ -13,6 +13,7 @@
#include "nvim/ex_docmd.h"
#include "nvim/lua/executor.h"
#include "nvim/ops.h"
#include "nvim/regexp.h"
#include "nvim/window.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -94,6 +95,7 @@ Dictionary nvim_parse_cmd(String str, Dictionary opts, Error *err)
}
goto end;
}
vim_regfree(cmdinfo.cmdmod.cmod_filter_regmatch.regprog);
// Parse arguments
Array args = ARRAY_DICT_INIT;