Thursday, August 11, 2011

Re: substitute function

it's odd, i just join the next two lines together with | ,and it works, thanks for your idea.
g/src=""/s//\='src="'.g:imglist[i].'"'/g
let i+=1


On Thu, Aug 11, 2011 at 3:44 PM, lith <minilith@gmail.com> wrote:

The way you broke that line down, variable i will be incremented only after running :g over the buffer.

This means it's up to the command if "|" is part of the argument or if it breaks a line into separate statements. This is confusing, since you have to check each commands documentation or run tests, but can also be quite useful. See also :help command-bar.

Regards,

Tom

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: