Saturday, June 15, 2013

Re: Bug with (or without) 'Z' in cpoptions writing to read-only file

Linda W wrote:

> > This used to work, but stopped about 18 months ago, I think.
> >
> > Now, I've both with 'Z' and without in cpoptions, but
> > notice when I write a file with "w!", the read-only flag
> > is still being reset to it's initial state.
> I have figured out at least one place that causes this..
>
> It seems that some .vim scripts ignore the options in cpo
> and install '&vim' options while the file is being
> saved, then restore cpo after the fact so it looks like
> the cpo options have no effect.
>
> I don't think it would be affecting my usage, but an example of this
> is in "menu.vim"...
> Several places, the purpose is to make sure the "<" and "C" flags
> are not included in cpoptions...
> But that's not what the code does -- it resets them to some arbitrary state.
>
> To remove those flags, one would use
> cpo-="<C"
> (as far as I know)....
>
> Trouble is, with examples like that in the official Vim code, there's no
> telling where else it might be a problem.
>
> though I noticed signs that I've edited out those problem areas before
> (but had my changes overwritten on a subsequent update.

Good point. However, for most plugins it's fine to reset 'cpo', since
they only setup mappings, highlighting, etc. And for these it's a lot
easier to just switch to a "sane state".

Unfortunately this means we have to pinpoint individual plugins to find
out what's wrong.

--
Your mouse has moved. Windows must be restarted for the change
to take effect. Reboot now?

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
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@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment