Open jamessan opened 12 years ago
This is one of those things where I'm inclined to say "we just shouldn't support it". I'd rather have the code be simple and obviously correct than able to support every oddity that Vim accepts. Is this really something useful enough that it's worth adding complexity?
For my particular usage, there's a workaround--vim: set isk+=58:
but that's likely the only option where you can use some other value to represent the :
. cinkeys, comments, errorformat, formatlistpat, formatexpr, include, includeexpr, indentexpr, indentkeys, iskeyword, and matchpairs seem to be most of the options which can be buffer-local, set in the modeline, and could likely have a :
in them.
Most of those would likely be better served by an ftplugin, but in one-off cases like what I ran into it's easier to just add the modeline. Although, of those options, iskeyword seems to me like the one that would most often fall into this one-off situation, so I'd be fine with the support not being added.
#
is another character in an option value that'll cause securemodelines to skip that item e.g. indentkeys-=0#
.
fwiw, you can fix this locally by adding the characters to the character class near the end of this regex. https://github.com/ciaranm/securemodelines/blob/9751f29699186a47743ff6c06e689f483058d77a/plugin/securemodelines.vim#L57
Currently, securemodelines parses
:
as a delimiter (either for the end of the modeline or for the end of an option) and doesn't handle a:
being used as part of the option's value. Vim also handles the escaping of:
in a modeline different than escaping in a normal set command.vim:set isk+=\::
andvim:set isk+=\\::
both do the same thing, when the former is what's documented to work and the latter is what one would expect when escaping something in a normal set command.