0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.3748: giving an error for an empty sign argument breaks a plugin

Problem:    Giving an error for an empty sign argument breaks a plugin.
Solution:   Do not give an error.
This commit is contained in:
Bram Moolenaar
2021-12-05 19:10:04 +00:00
parent 0bac5fc5e1
commit e5710a02cb
4 changed files with 2 additions and 37 deletions

View File

@@ -1310,17 +1310,6 @@ sign_jump(int sign_id, char_u *sign_group, buf_T *buf)
return lnum;
}
static int
check_empty_group(size_t len, char *name)
{
if (len == 0)
{
semsg(_(e_group_name_missing_for_str), name);
return FAIL;
}
return OK;
}
/*
* ":sign define {name} ..." command
*/
@@ -1335,10 +1324,6 @@ sign_define_cmd(char_u *sign_name, char_u *cmdline)
char_u *texthl = NULL;
char_u *culhl = NULL;
int failed = FALSE;
sign_T *sp_prev;
int exists;
exists = sign_find(sign_name, &sp_prev) != NULL;
// set values for a defined sign.
for (;;)
@@ -1360,31 +1345,16 @@ sign_define_cmd(char_u *sign_name, char_u *cmdline)
else if (STRNCMP(arg, "linehl=", 7) == 0)
{
arg += 7;
if (!exists && check_empty_group(p - arg, "linehl") == FAIL)
{
failed = TRUE;
break;
}
linehl = vim_strnsave(arg, p - arg);
}
else if (STRNCMP(arg, "texthl=", 7) == 0)
{
arg += 7;
if (!exists && check_empty_group(p - arg, "texthl") == FAIL)
{
failed = TRUE;
break;
}
texthl = vim_strnsave(arg, p - arg);
}
else if (STRNCMP(arg, "culhl=", 6) == 0)
{
arg += 6;
if (!exists && check_empty_group(p - arg, "culhl") == FAIL)
{
failed = TRUE;
break;
}
culhl = vim_strnsave(arg, p - arg);
}
else