139377Re: Something to wrap a selection
- Sep 29, 2013Harry Putnam <reader@...> a écrit:
> Paul Isambert <zappathustra@...> writes:If duty there was, it was only not to give you half-baked code. Plus
> > I say goodbye here, the code follows. I’ll hope you’ll be satisfied
> > this time (there might be glitches, I did not test the command much,
> > just basic tries).
> Oh boy, yup this baby works now.
> Man, you went so far beyond the call of duty, and let me tell you that
> it was really appreciated here.
writing scriptlets is so funnier than dish-washing.
> There are so many examples and techniques in that code I will beBut you should if the code goes wrong. By the way there was a small
> learning from it for a good while.
> Oh, and I promise not to post one more thing to this thread.. : )
let s:commentfile = expand("<sfile>:p:h") . "/.markchangerc"
let s:data = readfile(s:commentfile)
for line in s:data
if line !~ '^#' && line =~ '='
let s:matches = matchlist(line, '\([^=[:blank:]]\+\)\s*=\s*\(\S\+\)')
let s:markchangecomments[s:matches] = s:matches
you should replace all occurrences of “line” with “s:line”, otherwise
it defines a global variable whereas you want it to be only visible in
the script (I’m used to loop variables being local, à la Lua).
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
For more options, visit https://groups.google.com/groups/opt_out.
- << Previous post in topic