patch 9.1.1224: cannot :put while keeping indent
Problem: cannot :put while keeping indent (Peter Aronoff)
Solution: add the :iput ex command (64-bitman)
fixes: #16225
closes: #16886
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: 64-bitman <60551350+64-bitman@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9instr.c b/src/vim9instr.c
index 86fddd9..3da56bf 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -2188,15 +2188,17 @@
}
/*
- * Generate an ISN_PUT instruction.
+ * Generate an ISN_PUT or ISN_IPUT instruction depending on fixindent.
*/
int
-generate_PUT(cctx_T *cctx, int regname, linenr_T lnum)
+generate_PUT(cctx_T *cctx, int regname, linenr_T lnum, int fixindent)
{
isn_T *isn;
RETURN_OK_IF_SKIP(cctx);
- if ((isn = generate_instr(cctx, ISN_PUT)) == NULL)
+ isn = (fixindent) ? generate_instr(cctx, ISN_IPUT) :
+ generate_instr(cctx, ISN_PUT);
+ if (isn == NULL)
return FAIL;
isn->isn_arg.put.put_regname = regname;
isn->isn_arg.put.put_lnum = lnum;
@@ -2814,6 +2816,7 @@
case ISN_PUSHOBJ:
case ISN_PUSHSPEC:
case ISN_PUT:
+ case ISN_IPUT:
case ISN_REDIREND:
case ISN_REDIRSTART:
case ISN_RETURN: