diff options
author | luukvbaal <luukvbaal@gmail.com> | 2023-11-19 00:58:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-19 07:58:33 +0800 |
commit | a84b454ebe661981f292ee8fc73be4f9cd3a5884 (patch) | |
tree | 127c60eead43e957aa5ef14ed8ed63932a334240 /src | |
parent | debad0020c06180e275e158995aa5757ed56ae2d (diff) | |
download | rneovim-a84b454ebe661981f292ee8fc73be4f9cd3a5884.tar.gz rneovim-a84b454ebe661981f292ee8fc73be4f9cd3a5884.tar.bz2 rneovim-a84b454ebe661981f292ee8fc73be4f9cd3a5884.zip |
fix(sign): do not error when defining sign without attributes (#26106)
Fix https://github.com/airblade/vim-gitgutter/issues/875
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/sign.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/sign.c b/src/nvim/sign.c index 4f696f5c91..cc64a67866 100644 --- a/src/nvim/sign.c +++ b/src/nvim/sign.c @@ -578,11 +578,13 @@ static void sign_define_cmd(char *name, char *cmdline) char *texthl = NULL; char *culhl = NULL; char *numhl = NULL; - int failed = false; // set values for a defined sign. while (true) { char *arg = skipwhite(cmdline); + if (*arg == NUL) { + break; + } cmdline = skiptowhite_esc(arg); if (strncmp(arg, "icon=", 5) == 0) { icon = arg + 5; @@ -598,8 +600,7 @@ static void sign_define_cmd(char *name, char *cmdline) numhl = arg + 6; } else { semsg(_(e_invarg2), arg); - failed = true; - break; + return; } if (*cmdline == NUL) { break; @@ -607,9 +608,7 @@ static void sign_define_cmd(char *name, char *cmdline) *cmdline++ = NUL; } - if (!failed) { - sign_define_by_name(name, icon, text, linehl, texthl, culhl, numhl); - } + sign_define_by_name(name, icon, text, linehl, texthl, culhl, numhl); } /// ":sign place" command |