mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 14:58:18 +00:00
file_pat_to_reg_pat, buflist_findpat: const params
file_pat_to_reg_pat() and buflist_findpat() do not modify the data of these parameters.
This commit is contained in:
@@ -703,18 +703,16 @@ char_u *get_expr_line_src(void)
|
||||
/// @param writing allow only writable registers
|
||||
bool valid_yank_reg(int regname, bool writing)
|
||||
{
|
||||
if ( (regname > 0 && ASCII_ISALNUM(regname))
|
||||
|| (!writing && vim_strchr((char_u *)
|
||||
"/.%:="
|
||||
, regname) != NULL)
|
||||
|| regname == '#'
|
||||
|| regname == '"'
|
||||
|| regname == '-'
|
||||
|| regname == '_'
|
||||
|| regname == '*'
|
||||
|| regname == '+'
|
||||
)
|
||||
if ((regname > 0 && ASCII_ISALNUM(regname))
|
||||
|| (!writing && vim_strchr((char_u *) "/.%:=" , regname) != NULL)
|
||||
|| regname == '#'
|
||||
|| regname == '"'
|
||||
|| regname == '-'
|
||||
|| regname == '_'
|
||||
|| regname == '*'
|
||||
|| regname == '+') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4666,11 +4664,12 @@ void write_reg_contents_ex(int name,
|
||||
int num = atoi((char *)str);
|
||||
|
||||
buf = buflist_findnr(num);
|
||||
if (buf == NULL)
|
||||
if (buf == NULL) {
|
||||
EMSGN(_(e_nobufnr), (long)num);
|
||||
}
|
||||
} else {
|
||||
buf = buflist_findnr(buflist_findpat(str, str + STRLEN(str),
|
||||
true, false, false));
|
||||
true, false, false));
|
||||
}
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user