diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-03-29 20:25:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 20:25:09 -0400 |
commit | 3c497e214f48ee1433d759f5a56c028df5186f24 (patch) | |
tree | 8256f108b6f411df484062617d733e8f1217b4af /src/nvim/ops.c | |
parent | aa6adacd77e59b2cf2ca7bdeae9a24c062b2a9c0 (diff) | |
parent | af2f0ffdf4261bf1167f044ca771fa225f2ae977 (diff) | |
download | rneovim-3c497e214f48ee1433d759f5a56c028df5186f24.tar.gz rneovim-3c497e214f48ee1433d759f5a56c028df5186f24.tar.bz2 rneovim-3c497e214f48ee1433d759f5a56c028df5186f24.zip |
Merge pull request #14238 from janlazo/vim-8.1.0958
vim-patch:8.1.{874,958,989,2380},8.2.{1621,2674}
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index e5de57ceaa..2d351f4dba 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1079,13 +1079,15 @@ do_execreg( } } escaped = vim_strsave_escape_csi(reg->y_array[i]); - retval = ins_typebuf(escaped, remap, 0, TRUE, silent); + retval = ins_typebuf(escaped, remap, 0, true, silent); xfree(escaped); - if (retval == FAIL) + if (retval == FAIL) { return FAIL; - if (colon && ins_typebuf((char_u *)":", remap, 0, TRUE, silent) - == FAIL) + } + if (colon + && ins_typebuf((char_u *)":", remap, 0, true, silent) == FAIL) { return FAIL; + } } reg_executing = regname == 0 ? '"' : regname; // disable the 'q' command } @@ -1109,8 +1111,9 @@ static void put_reedit_in_typebuf(int silent) buf[0] = (char_u)(restart_edit == 'I' ? 'i' : restart_edit); buf[1] = NUL; } - if (ins_typebuf(buf, REMAP_NONE, 0, TRUE, silent) == OK) + if (ins_typebuf(buf, REMAP_NONE, 0, true, silent) == OK) { restart_edit = NUL; + } } } @@ -1130,25 +1133,29 @@ static int put_in_typebuf( int retval = OK; put_reedit_in_typebuf(silent); - if (colon) - retval = ins_typebuf((char_u *)"\n", REMAP_NONE, 0, TRUE, silent); + if (colon) { + retval = ins_typebuf((char_u *)"\n", REMAP_NONE, 0, true, silent); + } if (retval == OK) { char_u *p; - if (esc) + if (esc) { p = vim_strsave_escape_csi(s); - else + } else { p = s; - if (p == NULL) + } + if (p == NULL) { retval = FAIL; - else - retval = ins_typebuf(p, esc ? REMAP_NONE : REMAP_YES, - 0, TRUE, silent); - if (esc) + } else { + retval = ins_typebuf(p, esc ? REMAP_NONE : REMAP_YES, 0, true, silent); + } + if (esc) { xfree(p); + } + } + if (colon && retval == OK) { + retval = ins_typebuf((char_u *)":", REMAP_NONE, 0, true, silent); } - if (colon && retval == OK) - retval = ins_typebuf((char_u *)":", REMAP_NONE, 0, TRUE, silent); return retval; } |