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/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim
index 7a41b5d..27b71fe 100644
--- a/src/testdir/test_vim9_disassemble.vim
+++ b/src/testdir/test_vim9_disassemble.vim
@@ -286,6 +286,20 @@
res)
enddef
+def s:IputExpr()
+ :3iput ="text"
+enddef
+
+def Test_disassemble_iput_expr()
+ var res = execute('disass s:IputExpr')
+ assert_match('<SNR>\d*_IputExpr.*' ..
+ ' :3iput ="text"\_s*' ..
+ '\d PUSHS "text"\_s*' ..
+ '\d IPUT = 3\_s*' ..
+ '\d RETURN void',
+ res)
+enddef
+
def s:PutRange()
:$-2put a
:$-3put! b
@@ -305,6 +319,25 @@
res)
enddef
+def s:IputRange()
+ :$-2iput a
+ :$-3iput! b
+enddef
+
+def Test_disassemble_iput_range()
+ var res = execute('disass s:IputRange')
+ assert_match('<SNR>\d*_IputRange.*' ..
+ ' :$-2iput a\_s*' ..
+ '\d RANGE $-2\_s*' ..
+ '\d IPUT a range\_s*' ..
+
+ ' :$-3iput! b\_s*' ..
+ '\d RANGE $-3\_s*' ..
+ '\d IPUT b above range\_s*' ..
+ '\d RETURN void',
+ res)
+enddef
+
def s:ScriptFuncPush()
var localbool = true
var localspec = v:none