diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-06-17 22:00:15 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-06-17 22:00:15 +0000 |
commit | e756604ff50151c668154e64b56f615badffee2c (patch) | |
tree | 26dfa1ed68c8fc6a78fc5383dba795403f37a42b /src/ops.c | |
parent | f7bbbc506e1b28fae1edc0a4bb4e4218d1ea623a (diff) | |
download | vim-git-e756604ff50151c668154e64b56f615badffee2c.tar.gz |
updated for version 7.0087
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -5717,6 +5717,11 @@ write_reg_contents_ex(name, str, maxlen, must_append, yank_type, block_len) struct yankreg *old_y_previous, *old_y_current; long len; + if (maxlen >= 0) + len = maxlen; + else + len = (long)STRLEN(str); + /* Special case: '/' search pattern */ if (name == '/') { @@ -5724,6 +5729,26 @@ write_reg_contents_ex(name, str, maxlen, must_append, yank_type, block_len) return; } +#ifdef FEAT_EVAL + if (name == '=') + { + char_u *p, *s; + + p = vim_strnsave(str, (int)len); + if (p == NULL) + return; + if (must_append) + { + s = concat_str(get_expr_line_src(), p); + vim_free(p); + p = s; + + } + set_expr_line(p); + return; + } +#endif + if (!valid_yank_reg(name, TRUE)) /* check for valid reg name */ { emsg_invreg(name); @@ -5740,10 +5765,6 @@ write_reg_contents_ex(name, str, maxlen, must_append, yank_type, block_len) get_yank_register(name, TRUE); if (!y_append && !must_append) free_yank_all(); - if (maxlen >= 0) - len = maxlen; - else - len = (long)STRLEN(str); #ifndef FEAT_VISUAL /* Just in case - make sure we don't use MBLOCK */ if (yank_type == MBLOCK) |