diff options
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -856,11 +856,12 @@ valid_yank_reg(regname, writing) if ( (regname > 0 && ASCII_ISALNUM(regname)) || (!writing && vim_strchr((char_u *) #ifdef FEAT_EVAL - "/.%#:=" + "/.%:=" #else - "/.%#:" + "/.%:" #endif , regname) != NULL) + || regname == '#' || regname == '"' || regname == '-' || regname == '_' @@ -6514,6 +6515,27 @@ write_reg_contents_ex(name, str, maxlen, must_append, yank_type, block_len) return; } + if (name == '#') + { + buf_T *buf; + + if (VIM_ISDIGIT(*str)) + { + int num = atoi((char *)str); + + buf = buflist_findnr(num); + if (buf == NULL) + EMSGN(_(e_nobufnr), (long)num); + } + else + buf = buflist_findnr(buflist_findpat(str, str + STRLEN(str), + TRUE, FALSE, FALSE)); + if (buf == NULL) + return; + curwin->w_alt_fnum = buf->b_fnum; + return; + } + #ifdef FEAT_EVAL if (name == '=') { |