James McCoy wrote:

> > > There seems to be a snippet that's been cargo-culted into colorschemes,
> > > but I can't find justification for.
> > > 
> > >     if exists('syntax_on')
> > >       syntax reset
> > >     endif
> > > 
> > > Given that syntax items just link to highlight groups and it's the
> > > highlight groups which define the colors, why should a colorscheme be
> > > calling ":syntax reset"?
> > > 
> > > The reason I noticed this is that there's actually a noticeable impact
> > > of resetting the syntax now.  If there was before, I never encountered
> > > it.
> > > 
> > > If a syntax file is using ":syn iskeyword", then this is cleared when a
> > > user changes their colorscheme, breaking the highlighting that was in
> > > effect.  This can trivially be seen with the sh syntax.
> > > 
> > > --8<--
> > > #!/bin/sh
> > > apply_patch make-some-case-work
> > > 
> > > if true; then
> > >     echo Something
> > > fi
> > > -->8--
> > > 
> > > Given the above foo.sh, everything looks appropriately highlighted when
> > > initially opened.  Set the colorscheme again (even just back to what it
> > > is -- :exe 'color '.g:colors_name) and now the fi is highlighted as an
> > > error while most of the rest has lost its highlighting.
> > > 
> > > So, is this just a relic of the original implementation or is there
> > > an actual reason that this snippet needs to be put into colorschemes?
> > > If it's legitimate, shouldn't it be done by Vim instead of cargo-culted
> > > into every colorscheme?
> > 
> > The command is a bit of a misnomer, it actually only affects
> > highlighting.
> 
> Clearly that's not all it does since “syn iskeyword” is changed by “syn
> reset”.  If it's only *intended* to reset the highlighting, then it
> should be fixed to not also reset “syn iskeyword”.

Ah, that looks like a bug introduced by patch 7.4.1142.  The author also
was confused by the semantics of this command.


> Independent from the above bug fix, I think it would also be beneficial
> to have the effect of resetting highlighting to defaults automatically
> happen when “:colorscheme foo” is called.  There's no reason that every
> single colorscheme should have to add the “syn reset” command.

I believe this was discussed before.  I forgot what the reasoning was, I
think it was about the ordering of commands.

-- 
Some of the well known MS-Windows errors:
        EMEMORY         Memory error caused by..., eh...
        ELICENSE        Your license has expired, give us more money!
        EMOUSE          Mouse moved, reinstall Windows
        EILLEGAL        Illegal error, you are not allowed to see this
        EVIRUS          Undetectable virus found

 /// Bram Moolenaar -- [email protected] -- 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_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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui