vim-patch:9.1.1224: cannot :put while keeping indent (#33076)

Problem:  cannot :put while keeping indent (Peter Aronoff)
Solution: add the :iput ex command (64-bitman)

fixes: vim/vim#16225
closes: vim/vim#16886

e08f10a55c

Cherry-pick test_put.vim changes from patch 8.2.1593.

N/A patches:
vim-patch:9.1.1213: cannot :put while keeping indent
vim-patch:9.1.1215: Patch 9.1.1213 has some issues

Co-authored-by: 64-bitman <60551350+64-bitman@users.noreply.github.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
This commit is contained in:
zeertzjq
2025-03-27 09:06:46 +08:00
committed by GitHub
parent 8f40ffdb92
commit 750e1836af
7 changed files with 122 additions and 14 deletions

View File

@@ -504,7 +504,9 @@ String nvim_cmd(uint64_t channel_id, Dict(cmd) *cmd, Dict(cmd_opts) *opts, Arena
VALIDATE((regname != '='), "%s", "Cannot use register \"=", {
goto end;
});
VALIDATE(valid_yank_reg(regname, ea.cmdidx != CMD_put && !IS_USER_CMDIDX(ea.cmdidx)),
VALIDATE(valid_yank_reg(regname,
(!IS_USER_CMDIDX(ea.cmdidx)
&& ea.cmdidx != CMD_put && ea.cmdidx != CMD_iput)),
"Invalid register: \"%c", regname, {
goto end;
});