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/vim9cmds.c b/src/vim9cmds.c
index f8ebfb1..aeb742e 100644
--- a/src/vim9cmds.c
+++ b/src/vim9cmds.c
@@ -2161,9 +2161,12 @@
/*
* :put r
* :put ={expr}
+ * or if fixindent == TRUE
+ * :iput r
+ * :iput ={expr}
*/
char_u *
-compile_put(char_u *arg, exarg_T *eap, cctx_T *cctx)
+compile_put(char_u *arg, exarg_T *eap, cctx_T *cctx, int fixindent)
{
char_u *line = arg;
linenr_T lnum;
@@ -2202,7 +2205,8 @@
--lnum;
}
- generate_PUT(cctx, eap->regname, lnum);
+ generate_PUT(cctx, eap->regname, lnum, fixindent);
+
return line;
}