From 750e1836afb49b860fa11b4336a7ae351720a553 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 27 Mar 2025 09:06:46 +0800 Subject: 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 https://github.com/vim/vim/commit/e08f10a55c3f15b0b4af631908551d88ec4fe502 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 --- src/nvim/api/command.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nvim/api') diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c index de83ff97f7..4b93f09c61 100644 --- a/src/nvim/api/command.c +++ b/src/nvim/api/command.c @@ -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; }); -- cgit