[vim/vim] add :iput ex command (PR #16886)

15 views
Skip to first unread message

64-bitman

unread,
Mar 13, 2025, 9:55:30 PMMar 13
to vim/vim, Subscribed

Fixes #16225


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/16886

Commit Summary

File Changes

(6 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886@github.com>

64-bitman

unread,
Mar 13, 2025, 10:06:09 PMMar 13
to vim/vim, Push

@64-bitman pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/f88b26adbd4ab713dbdaaf037790c55b0226ab56/after/822f6b411fc34bdd950fe0c5fc2b19d0276198ae@github.com>

zeertzjq

unread,
Mar 13, 2025, 11:10:55 PMMar 13
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In runtime/doc/change.txt:

> @@ -1149,6 +1149,11 @@ inside of strings can change!  Also see 'softtabstop' option. >
 :[line]pu[t]! [x]	Put the text [from register x] before [line] (default
 			current line).
 
+							*:ipu* *:iput*
+:[line]ipu[t] [x]	like |:put|, but adjust indent to the current line
⬇️ Suggested change
-:[line]ipu[t] [x]	like |:put|, but adjust indent to the current line
+:[line]ip[ut] [x]	like |:put|, but adjust indent to the current line


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2683956165@github.com>

zeertzjq

unread,
Mar 13, 2025, 11:11:05 PMMar 13
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In runtime/doc/change.txt:

> @@ -1149,6 +1149,11 @@ inside of strings can change!  Also see 'softtabstop' option. >
 :[line]pu[t]! [x]	Put the text [from register x] before [line] (default
 			current line).
 
+							*:ipu* *:iput*
+:[line]ipu[t] [x]	like |:put|, but adjust indent to the current line
+
+:[line]ipu[t]! [x]	like |:put!|, but adjust indent to the current line
⬇️ Suggested change
-:[line]ipu[t]! [x]	like |:put!|, but adjust indent to the current line
+:[line]ip[ut]! [x]	like |:put!|, but adjust indent to the current line


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2683956315@github.com>

zeertzjq

unread,
Mar 13, 2025, 11:11:19 PMMar 13
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In runtime/doc/index.txt:

> @@ -1559,6 +1559,8 @@ tag		command		action ~
 |:ptselect|	:pts[elect]	|:tselect| and show tag in preview window
 |:public|	:public		prefix for a class or object member
 |:put|		:pu[t]		insert contents of register in the text
+|:iput|		:ipu[t]		like |:put|, but adjust the indent to the 
⬇️ Suggested change
-|:iput|		:ipu[t]		like |:put|, but adjust the indent to the 
+|:iput|		:ip[ut]		like |:put|, but adjust the indent to the 


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2683957465@github.com>

zeertzjq

unread,
Mar 13, 2025, 11:11:24 PMMar 13
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In runtime/doc/change.txt:

> @@ -1149,6 +1149,11 @@ inside of strings can change!  Also see 'softtabstop' option. >
 :[line]pu[t]! [x]	Put the text [from register x] before [line] (default
 			current line).
 
+							*:ipu* *:iput*
⬇️ Suggested change
-							*:ipu* *:iput*
+							*:ip* *:iput*


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2683958087@github.com>

zeertzjq

unread,
Mar 13, 2025, 11:11:51 PMMar 13
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/ex_cmds.h:

> +EXCMD(CMD_iput,		"iput",		ex_iput,
+	EX_RANGE|EX_WHOLEFOLD|EX_BANG|EX_REGSTR|EX_TRLBAR|EX_ZEROR|EX_CMDWIN|EX_LOCK_OK|EX_MODIFY,
+	ADDR_LINES),

This should appear near other Ex commands that start with 'i'.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2683959012@github.com>

Yegappan Lakshmanan

unread,
Mar 14, 2025, 1:34:17 AMMar 14
to vim/vim, Subscribed

@yegappan commented on this pull request.


In src/testdir/test_put.vim:

> @@ -75,6 +75,8 @@ func Test_put_fails_when_nomodifiable()
   normal! yy
   call assert_fails(':put', 'E21:')
   call assert_fails(':put!', 'E21:')
+  call assert_fails(':iput', 'E21:')
+  call assert_fails(':iput!', 'E21:')
   call assert_fails(':normal! p', 'E21:')

The new command needs a lot more tests.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2684327605@github.com>

zeertzjq

unread,
Mar 14, 2025, 1:37:25 AMMar 14
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In runtime/doc/index.txt:

> @@ -1559,6 +1559,8 @@ tag		command		action ~
 |:ptselect|	:pts[elect]	|:tselect| and show tag in preview window
 |:public|	:public		prefix for a class or object member
 |:put|		:pu[t]		insert contents of register in the text
+|:iput|		:ipu[t]		like |:put|, but adjust the indent to the 

This one should also be moved between :interface and :isearch


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2684339498@github.com>

64-bitman

unread,
Mar 14, 2025, 1:51:42 AMMar 14
to vim/vim, Push

@64-bitman pushed 2 commits.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/822f6b411fc34bdd950fe0c5fc2b19d0276198ae/after/64369a083a9a41c57de0137d6087f156708a7dd6@github.com>

64-bitman

unread,
Mar 14, 2025, 1:53:22 AMMar 14
to vim/vim, Subscribed

@64-bitman commented on this pull request.


In src/testdir/test_put.vim:

> @@ -75,6 +75,8 @@ func Test_put_fails_when_nomodifiable()
   normal! yy
   call assert_fails(':put', 'E21:')
   call assert_fails(':put!', 'E21:')
+  call assert_fails(':iput', 'E21:')
+  call assert_fails(':iput!', 'E21:')
   call assert_fails(':normal! p', 'E21:')

The new command needs a lot more tests.

Could you describe some?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2684379693@github.com>

64-bitman

unread,
Mar 14, 2025, 3:56:11 AMMar 14
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/64369a083a9a41c57de0137d6087f156708a7dd6/after/0fd8cda12d232d8a1f816a5b15ccba7915e74016@github.com>

Yegappan Lakshmanan

unread,
Mar 14, 2025, 10:08:47 AMMar 14
to vim/vim, Subscribed

@yegappan commented on this pull request.


In src/testdir/test_put.vim:

> @@ -75,6 +75,8 @@ func Test_put_fails_when_nomodifiable()
   normal! yy
   call assert_fails(':put', 'E21:')
   call assert_fails(':put!', 'E21:')
+  call assert_fails(':iput', 'E21:')
+  call assert_fails(':iput!', 'E21:')
   call assert_fails(':normal! p', 'E21:')

The following is a list of possible tests:

  1. Yank some lines (with a different indentation) and paste it after an indented line and make sure the pasted lines are indented.
  2. Try pasting before the first line and after the first line.
  3. Try pasting a line with no indentation and check the indentation of the pasted lines.
  4. Specify invalid range to the ":iput" command.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2685681927@github.com>

Yegappan Lakshmanan

unread,
Mar 14, 2025, 10:09:20 AMMar 14
to vim/vim, Subscribed

@yegappan commented on this pull request.


In src/testdir/test_put.vim:

> @@ -75,6 +75,8 @@ func Test_put_fails_when_nomodifiable()
   normal! yy
   call assert_fails(':put', 'E21:')
   call assert_fails(':put!', 'E21:')
+  call assert_fails(':iput', 'E21:')
+  call assert_fails(':iput!', 'E21:')
   call assert_fails(':normal! p', 'E21:')
  1. As you have added code to compile the iput command, you need to a Vim9 script test where a def function calls the iput command.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2685684368@github.com>

64-bitman

unread,
Mar 14, 2025, 2:33:44 PMMar 14
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/0fd8cda12d232d8a1f816a5b15ccba7915e74016/after/ca3940ee681b3445b6ff6170327301aaf3e50780@github.com>

64-bitman

unread,
Mar 14, 2025, 2:34:08 PMMar 14
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/ca3940ee681b3445b6ff6170327301aaf3e50780/after/fda5003c7422b104a99568e10615ba1a93300096@github.com>

64-bitman

unread,
Mar 14, 2025, 2:49:54 PMMar 14
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/fda5003c7422b104a99568e10615ba1a93300096/after/efc9236301c12124e21de0708389acf66aec97a1@github.com>

64-bitman

unread,
Mar 14, 2025, 3:16:23 PMMar 14
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/efc9236301c12124e21de0708389acf66aec97a1/after/3d339b8b8ea867848b2d877a6f7a78e2eb35eba0@github.com>

64-bitman

unread,
Mar 14, 2025, 3:19:17 PMMar 14
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/3d339b8b8ea867848b2d877a6f7a78e2eb35eba0/after/8b3e3ccf6760f78d1819c484a93f0a694d9337bf@github.com>

64-bitman

unread,
Mar 14, 2025, 3:35:58 PMMar 14
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/8b3e3ccf6760f78d1819c484a93f0a694d9337bf/after/fa37bb8c6dcccae13ac805cacc44a0bca974e5a8@github.com>

64-bitman

unread,
Mar 14, 2025, 3:37:42 PMMar 14
to vim/vim, Subscribed

I think everything is ready


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2725591377@github.com>

64-bitman64-bitman left a comment (vim/vim#16886)

I think everything is ready


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2725591377@github.com>

Christian Brabandt

unread,
Mar 16, 2025, 4:20:56 PMMar 16
to vim/vim, Subscribed

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2727629587@github.com>

chrisbrachrisbra left a comment (vim/vim#16886)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2727629587@github.com>

Christian Brabandt

unread,
Mar 16, 2025, 4:21:02 PMMar 16
to vim/vim, Subscribed

Closed #16886 via 250739d.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/issue_event/16792013098@github.com>

Christian Brabandt

unread,
Mar 16, 2025, 4:39:52 PMMar 16
to vim/vim, Subscribed

There are a few errors here, which I unfortunately did not notice. So I'll revert this for now. Can you please check CI logs?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2727636400@github.com>

chrisbrachrisbra left a comment (vim/vim#16886)

There are a few errors here, which I unfortunately did not notice. So I'll revert this for now. Can you please check CI logs?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2727636400@github.com>

Christian Brabandt

unread,
Mar 16, 2025, 4:42:36 PMMar 16
to vim/vim, Subscribed

Reopened #16886.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/issue_event/16792060292@github.com>

Peter Aronoff

unread,
Mar 16, 2025, 4:58:21 PMMar 16
to vim/vim, Subscribed

Thank you!


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2727643144@github.com>

telemachustelemachus left a comment (vim/vim#16886)

Thank you!


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2727643144@github.com>

64-bitman

unread,
Mar 16, 2025, 6:54:17 PMMar 16
to vim/vim, Subscribed

There are a few errors here, which I unfortunately did not notice. So I'll revert this for now. Can you please check CI logs?

Sure.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2727695596@github.com>

64-bitman64-bitman left a comment (vim/vim#16886)

There are a few errors here, which I unfortunately did not notice. So I'll revert this for now. Can you please check CI logs?

Sure.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2727695596@github.com>

64-bitman

unread,
Mar 16, 2025, 7:00:28 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 369ce1e add ISN_IPUT instruction to delete_instr()


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/fa37bb8c6dcccae13ac805cacc44a0bca974e5a8/after/369ce1e32529f6825aff1d2935521f0d57ebef3a@github.com>

64-bitman

unread,
Mar 16, 2025, 7:12:33 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/369ce1e32529f6825aff1d2935521f0d57ebef3a/after/f7fdc5674a046968215e8074f6ca68a6f224ec04@github.com>

64-bitman

unread,
Mar 16, 2025, 7:18:49 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/f7fdc5674a046968215e8074f6ca68a6f224ec04/after/fd099744fa46ab03635a7575782b048987255908@github.com>

64-bitman

unread,
Mar 16, 2025, 7:23:42 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/fd099744fa46ab03635a7575782b048987255908/after/76cc8da519bc2fd42414a67c4640280c8f0201e3@github.com>

64-bitman

unread,
Mar 16, 2025, 7:45:17 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/76cc8da519bc2fd42414a67c4640280c8f0201e3/after/2167bed5cc9610fe33085fb0a308cbb6fa3b689f@github.com>

64-bitman

unread,
Mar 16, 2025, 7:50:56 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/2167bed5cc9610fe33085fb0a308cbb6fa3b689f/after/af7bb170cba3debff98211a6de4498fe90dd126f@github.com>

Yegappan Lakshmanan

unread,
Mar 16, 2025, 7:54:41 PMMar 16
to vim/vim, Subscribed

@yegappan commented on this pull request.


In src/vim9.h:

> @@ -200,6 +200,7 @@ typedef enum {
     ISN_USEDICT,    // use or clear dict saved by ISN_MEMBER/ISN_STRINGMEMBER
 
     ISN_PUT,	    // ":put", uses isn_arg.put
+    ISN_IPUT,	    // ":iput", uses isn_arg.put

Can you add a new test to the test_vim9_disassemble.vim file for this new instruction?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2688870042@github.com>

Yegappan Lakshmanan

unread,
Mar 16, 2025, 7:59:20 PMMar 16
to vim/vim, Subscribed

@yegappan requested changes on this pull request.


In src/testdir/test_put.vim:

> @@ -328,4 +330,63 @@ func Test_put_list()
   bw!
 endfunc
 
+func Test_iput_multiline()
+  new
+  setlocal noexpandtab
+  call feedkeys("i\<Tab>foo", 'x')

You can use setline() or append() instead of feedkeys() here.


In src/testdir/test_put.vim:

> +  call feedkeys("i\<Tab>foo", 'x')
+  call setreg('0', "bar\n\<Tab>bar2\nbar3", 'l')
+  exe "iput"
+  call assert_equal(["\<Tab>bar", "\<Tab>\<Tab>bar2", "\<Tab>bar3"], getline(2, 4))
+  setlocal expandtab tabstop=8 shiftwidth=8 noshiftround
+  exe "iput"
+  call assert_equal([repeat(' ', 8) . "bar",
+        \ repeat(' ', 16) . "bar2",
+        \ repeat(' ', 8) . "bar3"], getline(5, 7))
+  bw!
+endfunc
+
+func Test_iput_beforeafter_tab()
+  new
+  setlocal noexpandtab
+  call feedkeys("i\<Tab>foo", 'x')

You can use setline() or append() here.


In src/testdir/test_put.vim:

> @@ -328,4 +330,63 @@ func Test_put_list()
   bw!
 endfunc
 
+func Test_iput_multiline()
+  new
+  setlocal noexpandtab
+  call feedkeys("i\<Tab>foo", 'x')
+  call setreg('0', "bar\n\<Tab>bar2\nbar3", 'l')
+  exe "iput"

No need to use "exe" here. You can use the command "iput" by itself.


In src/testdir/test_put.vim:

> +endfunc
+
+func Test_iput_invalidrange()
+  new
+  call setreg('0', "bar", 'l')
+  call assert_fails(':10iput', 'E16:')
+  bw!
+endfunc
+
+func Test_iput_not_put()
+  new
+  call feedkeys("i\<Tab>foo", 'x')
+  call setreg('0', "bar", 'l')
+  exe "iput"
+  call assert_equal("\<Tab>bar", getline(2))
+  exe "put"

You can remove "exe" from all of these tests for "iput" and "put".


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2688870689@github.com>

64-bitman

unread,
Mar 16, 2025, 8:09:20 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/af7bb170cba3debff98211a6de4498fe90dd126f/after/7a765fd12fe7cc172cd013e4a20d15a34d58011e@github.com>

64-bitman

unread,
Mar 16, 2025, 8:13:17 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/7a765fd12fe7cc172cd013e4a20d15a34d58011e/after/02946c614258508fe6935f467f457922b37a020d@github.com>

Yegappan Lakshmanan

unread,
Mar 16, 2025, 8:15:32 PMMar 16
to vim/vim, Subscribed

@yegappan requested changes on this pull request.


In src/testdir/test_put.vim:

> @@ -328,4 +330,63 @@ func Test_put_list()
   bw!
 endfunc
 
+func Test_iput_multiline()
+  new
+  setlocal noexpandtab
+  call setline(1, "\<Tab>foo")
+  call setreg('0', "bar\n\<Tab>bar2\nbar3", 'l')
+  iput
+  call assert_equal(["\<Tab>bar", "\<Tab>\<Tab>bar2", "\<Tab>bar3"], getline(2, 4))
+  setlocal expandtab tabstop=8 shiftwidth=8 noshiftround
+  exe "iput"

Can you remove "exe" from here?


In src/testdir/test_put.vim:

> +  iput
+  call assert_equal(["\<Tab>bar", "\<Tab>\<Tab>bar2", "\<Tab>bar3"], getline(2, 4))
+  setlocal expandtab tabstop=8 shiftwidth=8 noshiftround
+  exe "iput"
+  call assert_equal([repeat(' ', 8) . "bar",
+        \ repeat(' ', 16) . "bar2",
+        \ repeat(' ', 8) . "bar3"], getline(5, 7))
+  bw!
+endfunc
+
+func Test_iput_beforeafter_tab()
+  new
+  setlocal noexpandtab
+  call setline(1, "\<Tab>foo")
+  call setreg('0', "bar", 'l')
+  exe "iput"

Can you remove "exe" from here?


In src/testdir/test_put.vim:

> +  exe "iput"
+  call assert_equal([repeat(' ', 8) . "bar",
+        \ repeat(' ', 16) . "bar2",
+        \ repeat(' ', 8) . "bar3"], getline(5, 7))
+  bw!
+endfunc
+
+func Test_iput_beforeafter_tab()
+  new
+  setlocal noexpandtab
+  call setline(1, "\<Tab>foo")
+  call setreg('0', "bar", 'l')
+  exe "iput"
+  call assert_equal(["\<Tab>bar"], getline(2, '$'))
+  call feedkeys("k", 'x')
+  exe "iput!"

Can you remove "exe" from here?


In src/testdir/test_put.vim:

> +  call setreg('0', "bar", 'l')
+  exe "iput"
+  call assert_equal(["\<Tab>bar"], getline(2, '$'))
+  call feedkeys("k", 'x')
+  exe "iput!"
+  call assert_equal("\<Tab>bar", getline(1))
+  call assert_equal("\<Tab>bar", getline(3))
+  bw!
+endfunc
+
+func Test_iput_beforeafter_expandtab()
+  new
+  setlocal expandtab tabstop=8 shiftwidth=8 noshiftround
+  call feedkeys("i\<Tab>foo", 'x')
+  call setreg('0', "bar", 'l')
+  exe "iput"

Can you remove "exe" from here?


In src/testdir/test_put.vim:

> +  call assert_equal(["\<Tab>bar"], getline(2, '$'))
+  call feedkeys("k", 'x')
+  exe "iput!"
+  call assert_equal("\<Tab>bar", getline(1))
+  call assert_equal("\<Tab>bar", getline(3))
+  bw!
+endfunc
+
+func Test_iput_beforeafter_expandtab()
+  new
+  setlocal expandtab tabstop=8 shiftwidth=8 noshiftround
+  call feedkeys("i\<Tab>foo", 'x')
+  call setreg('0', "bar", 'l')
+  exe "iput"
+  call assert_equal([repeat(' ', 8) . "bar"], getline(2, '$'))
+  exe "1iput!"

Can you remove "exe" from here?


In src/vim9execute.c:

> @@ -7619,7 +7635,18 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
 						 iptr->isn_arg.put.put_regname,
 					     (long)iptr->isn_arg.put.put_lnum);
 		break;
-
+	    case ISN_IPUT:
+		if (iptr->isn_arg.put.put_lnum == LNUM_VARIABLE_RANGE_ABOVE)
+		    smsg("%s%4d PUT %c above range",

To differentiate this instruction from "ISN_PUT", can you use "IPUT" instead "PUT" here?


In src/vim9execute.c:

> @@ -7619,7 +7635,18 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
 						 iptr->isn_arg.put.put_regname,
 					     (long)iptr->isn_arg.put.put_lnum);
 		break;
-
+	    case ISN_IPUT:
+		if (iptr->isn_arg.put.put_lnum == LNUM_VARIABLE_RANGE_ABOVE)
+		    smsg("%s%4d PUT %c above range",
+				  pfx, current, iptr->isn_arg.put.put_regname);
+		else if (iptr->isn_arg.put.put_lnum == LNUM_VARIABLE_RANGE)
+		    smsg("%s%4d PUT %c range",

To differentiate this instruction from "ISN_PUT", can you use "IPUT" instead "PUT" here?


In src/vim9execute.c:

> @@ -7619,7 +7635,18 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
 						 iptr->isn_arg.put.put_regname,
 					     (long)iptr->isn_arg.put.put_lnum);
 		break;
-
+	    case ISN_IPUT:
+		if (iptr->isn_arg.put.put_lnum == LNUM_VARIABLE_RANGE_ABOVE)
+		    smsg("%s%4d PUT %c above range",
+				  pfx, current, iptr->isn_arg.put.put_regname);
+		else if (iptr->isn_arg.put.put_lnum == LNUM_VARIABLE_RANGE)
+		    smsg("%s%4d PUT %c range",
+				  pfx, current, iptr->isn_arg.put.put_regname);
+		else
+		    smsg("%s%4d PUT %c %ld", pfx, current,

To differentiate this instruction from "ISN_PUT", can you use "IPUT" instead "PUT" here?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2688878036@github.com>

64-bitman

unread,
Mar 16, 2025, 8:17:51 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/02946c614258508fe6935f467f457922b37a020d/after/978479a0246fb33b84c52011a34d4676fd94ff06@github.com>

64-bitman

unread,
Mar 16, 2025, 8:19:17 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/978479a0246fb33b84c52011a34d4676fd94ff06/after/5f5380212f4b3c335b9e675334fb9714b3431287@github.com>

64-bitman

unread,
Mar 16, 2025, 8:30:24 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/5f5380212f4b3c335b9e675334fb9714b3431287/after/32239064719b7e98ab883fff99fd525259b80cb4@github.com>

64-bitman

unread,
Mar 16, 2025, 8:55:53 PMMar 16
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/32239064719b7e98ab883fff99fd525259b80cb4/after/5170b106eabbe5962ab75290c15e62a230c2684a@github.com>

h_east

unread,
Mar 17, 2025, 10:34:24 AMMar 17
to vim/vim, Subscribed

@h-east commented on this pull request.


In src/ex_docmd.c:

> +	if (valid_yank_reg(*ea.arg, ((ea.cmdidx != CMD_put && ea.cmdidx != CMD_iput)
 					      && !IS_USER_CMDIDX(ea.cmdidx))))
  • Fixed over 80 columns.
  • There is an extra parentheses.
  • (Although I changed the order) I think this is better.
⬇️ Suggested change
-	if (valid_yank_reg(*ea.arg, ((ea.cmdidx != CMD_put && ea.cmdidx != CMD_iput)
-					      && !IS_USER_CMDIDX(ea.cmdidx))))
+	if (valid_yank_reg(*ea.arg, (!IS_USER_CMDIDX(ea.cmdidx)
+			    && ea.cmdidx != CMD_put && ea.cmdidx != CMD_iput)))


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2690761672@github.com>

64-bitman

unread,
Mar 17, 2025, 6:15:55 PMMar 17
to vim/vim, Push

@64-bitman pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/5170b106eabbe5962ab75290c15e62a230c2684a/after/5b0f09bedffbd63a001aa552b7677fbb4b64be08@github.com>

64-bitman

unread,
Mar 17, 2025, 7:23:01 PMMar 17
to vim/vim, Push

@64-bitman pushed 1 commit.

  • d38ce33 Merge branch 'master' into 16225

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/5b0f09bedffbd63a001aa552b7677fbb4b64be08/after/d38ce33dcca8979888b17770e51325cc3c84d8b7@github.com>

64-bitman

unread,
Mar 17, 2025, 7:39:31 PMMar 17
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/d38ce33dcca8979888b17770e51325cc3c84d8b7/after/cb08e83ac08a7da92f4e27b6b3ff3dd6b0965d2a@github.com>

zeertzjq

unread,
Mar 17, 2025, 8:08:31 PMMar 17
to vim/vim, Push

@zeertzjq pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/cb08e83ac08a7da92f4e27b6b3ff3dd6b0965d2a/after/2637dfbcab5fe38fb16b59c5172ec6b8503f972f@github.com>

zeertzjq

unread,
Mar 17, 2025, 8:10:01 PMMar 17
to vim/vim, Subscribed

There are some incorrect test changes after the merge from master branch. I pushed a commit to fix them.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2731237817@github.com>

zeertzjqzeertzjq left a comment (vim/vim#16886)

There are some incorrect test changes after the merge from master branch. I pushed a commit to fix them.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2731237817@github.com>

zeertzjq

unread,
Mar 17, 2025, 8:10:13 PMMar 17
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/vim9execute.c:

> @@ -3252,6 +3252,58 @@ var_any_get_oc_member(class_T *current_class, isn_T *iptr, typval_T *tv)
     return OK;
 }
 
+/*
+ * do ISN_PUT or ISN_IPUT instruction depending on fixindent parameter
+ */
+    static void
+isn_put_do (ectx_T *ectx, isn_T *iptr, typval_T *tv, int fixindent)
⬇️ Suggested change
-isn_put_do (ectx_T *ectx, isn_T *iptr, typval_T *tv, int fixindent)
+isn_put_do(ectx_T *ectx, isn_T *iptr, typval_T *tv, int fixindent)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/review/2692411760@github.com>

64-bitman

unread,
Mar 17, 2025, 9:13:47 PMMar 17
to vim/vim, Push

@64-bitman pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/before/2637dfbcab5fe38fb16b59c5172ec6b8503f972f/after/7c1ae8012baa043f484292a95ddea0df0b4d7bde@github.com>

64-bitman

unread,
Mar 18, 2025, 5:24:01 PMMar 18
to vim/vim, Subscribed

I think this is ready


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2734764904@github.com>

64-bitman64-bitman left a comment (vim/vim#16886)

I think this is ready


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2734764904@github.com>

Christian Brabandt

unread,
Mar 18, 2025, 5:32:12 PMMar 18
to vim/vim, Subscribed

Closed #16886 via e08f10a.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/issue_event/16850369912@github.com>

Christian Brabandt

unread,
Mar 18, 2025, 5:33:03 PMMar 18
to vim/vim, Subscribed

Thanks. It was a bit complicated to get all changes merged into a single commit, but I think I made it :)
I also added another test for :0iput. Thanks all.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2734783394@github.com>

chrisbrachrisbra left a comment (vim/vim#16886)

Thanks. It was a bit complicated to get all changes merged into a single commit, but I think I made it :)
I also added another test for :0iput. Thanks all.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2734783394@github.com>

Peter Aronoff

unread,
Mar 18, 2025, 7:29:45 PMMar 18
to vim/vim, Subscribed

Thanks to everyone for adding this.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2734948976@github.com>

telemachustelemachus left a comment (vim/vim#16886)

Thanks to everyone for adding this.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16886/c2734948976@github.com>

Reply all
Reply to author
Forward
0 new messages