Christian wrote:

> currently setting 'isk' option has - among others - an unwanted side 
> effect on the syntax highlighting.
> 
> For example by removing the '_' from the 'iskeyword' setting, defined 
> syntax keywords start matching where they didn't match before.
> 
> E.g. in a SQL buffer, 
> 
> CREATE TABLE FOOBAR(
>      CRTD_BY     VARCHAR2(100));
> 
> Setting :setlocal isk-=_ will make the 'BY' highlighted as syntax 
> keyword. I believe this is unwanted and therefore I propose the 
> following enhancement:
> 
> Add a new syntax command ":syn option iskeyword" for specifically 
> setting the 'iskeyword' setting to sane values. So in a syntax file, one 
> could set: >
>     :syn option iskeyword @,48-57,_,192-255
> <
> and have syntax highlighting make work as expected independent on the 
> users choice of setting the 'isk' setting. If this is not done, syntax 
> highlighting will depend on the users 'isk' setting as before.
> 
> The current syntax iskeyword setting can be seen by using: >
>      :syn option iskeyword
> <
> 
> And it can be reset to the old behaviour using: >
>      :syn option iskeyword clear
> <
> 
> I did add the syn-option command, so that later on, it can be extended 
> to other options as well, if this should be necessary.
> 
> Attached is a proof of concept patch, that does this. 
> 
> Any comments?

Separately defining keyword characters in different contexts has been a
todo item for a very long time.

I suppose that for syntax highlighting using a :syntax command is
appropriate.  For other contexts we might still want to use an actual
setting.

Not sure about the ":syn option" command.  Why not use ":syn iskeyword"?
In a way, all :syn commands change options/settings in some way.

I would not see this as an option, but part of the syntax definition.
Thus ":syn clear" removes it and goes back to 'iskeyword'.


-- 
Over the years, I've developed my sense of deja vu so acutely that now
I can remember things that *have* happened before ...

 /// 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