From 7e1cf6b7642f0ab14656d853d44f4409b2987b9c Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Tue, 28 Jun 2022 11:00:05 +0600 Subject: fix(inccommand): parse the command to check if it is previewable Free regprog if command isn't previewable Co-authored-by: zeertzjq --- src/nvim/api/command.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/api') diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c index 141e1256ff..2b2fb446a0 100644 --- a/src/nvim/api/command.c +++ b/src/nvim/api/command.c @@ -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; -- cgit