On 27-Dec-2010 16:11, Samuel Ferencik wrote:
> Hi,
> 
> I have a long SQL script, for which I use folding. Every (multi-line) SQL
> statement is folded.
> 
> Suppose I want to delete all the lines which don't contain the string 
> "varchar".
> I run
>     :v/varchar/normal dd
> Surprisingly, everything is deleted. It is as if "dd" was pressed on each
> (closed) fold, deleting all its lines. Since each fold contains at least one
> line without "varchar", all folds are "dd"-ed.
> 
> Compare with
>     :v/varchar/d
> which really deletes only lines which don't contain "varchar".
> 
> Is this a feature, or does it need attention?

It's a feature (mostly useful for scripting). Normal-mode commands do not open
folds when executed via :normal. IIRC, this was already discussed on this list;
you could search the archive. Remedy (besides the better alternative you've
already given):
     :v/varchar/normal zvdd

-- regards, ingo

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui