Tim Chase wrote:

> In Vim7, the :s command added a "n" flag to not actually perform 
> the substitute, but just report the number of changes made.
> 
> However, it seems that if 'modifiable' is off, one can't do 
> something like
> 
>       :%s/foo/bar/gn
> 
> to count items in the non-modifiable file, as it gives
> 
> "E21: Cannot make changes, 'modifiable' is off"
>
> which seems a bit counter-intuitive, as one's not actually making 
> changes.
> 
>    [n]        Report the number of matches, do not actually substitute.
> 
> I don't know if this qualifies as a bug (if nomodifiable is set, 
> a :s/foo/bar/n[g] command should be allowed), a pecularity, or 
> "desired" behavior, but I didn't see anything in the docs for 
> s_flags about the matter one way or the other.

I don't get this, it works as expected for me.

I have no idea how you can get this error message with the 'n' flag.

-- 
Lawmakers made it obligatory for everybody to take at least one bath
each week -- on Saturday night.
                [real standing law in Vermont, United States of America]

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to