Groups
Groups
Sign in
Groups
Groups
vim_dev
Conversations
About
Send feedback
Help
vim9 :0put puts after the first line
10 views
Skip to first unread message
JohnBeckett
unread,
Feb 7, 2022, 1:16:15 AM
2/7/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim_dev
I think this is a Vim 8.2.4293 bug but as it's from my first vim9script it might be me. Save the following to a file and source it (:so %).
vim9script
def Main(): void
@a = "one\ntwo\nthree"
new
put =@a
:1d
:0put ='This should be the first line.'
enddef
Main()
The result is:
one
This should be the first line.
two
three
Using :1put! instead of :0put gives the same result.
Sourcing the following shows the correct order.
function Main()
let @a = "one\ntwo\nthree"
new
put =@a
:1d
:0put ='This should be the first line.'
endfunction
call Main()
John
Reply all
Reply to author
Forward
0 new messages