mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(sign): do not error when defining sign without attributes (#26106)
Fix https://github.com/airblade/vim-gitgutter/issues/875
This commit is contained in:
@@ -578,11 +578,13 @@ static void sign_define_cmd(char *name, char *cmdline)
|
|||||||
char *texthl = NULL;
|
char *texthl = NULL;
|
||||||
char *culhl = NULL;
|
char *culhl = NULL;
|
||||||
char *numhl = NULL;
|
char *numhl = NULL;
|
||||||
int failed = false;
|
|
||||||
|
|
||||||
// set values for a defined sign.
|
// set values for a defined sign.
|
||||||
while (true) {
|
while (true) {
|
||||||
char *arg = skipwhite(cmdline);
|
char *arg = skipwhite(cmdline);
|
||||||
|
if (*arg == NUL) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
cmdline = skiptowhite_esc(arg);
|
cmdline = skiptowhite_esc(arg);
|
||||||
if (strncmp(arg, "icon=", 5) == 0) {
|
if (strncmp(arg, "icon=", 5) == 0) {
|
||||||
icon = arg + 5;
|
icon = arg + 5;
|
||||||
@@ -598,8 +600,7 @@ static void sign_define_cmd(char *name, char *cmdline)
|
|||||||
numhl = arg + 6;
|
numhl = arg + 6;
|
||||||
} else {
|
} else {
|
||||||
semsg(_(e_invarg2), arg);
|
semsg(_(e_invarg2), arg);
|
||||||
failed = true;
|
return;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (*cmdline == NUL) {
|
if (*cmdline == NUL) {
|
||||||
break;
|
break;
|
||||||
@@ -607,9 +608,7 @@ static void sign_define_cmd(char *name, char *cmdline)
|
|||||||
*cmdline++ = NUL;
|
*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
|
/// ":sign place" command
|
||||||
|
Reference in New Issue
Block a user