Makefiles can have commands such as:
BAR = $(subst ', '\'', $(FOO))
Here the first argument to
subst is a single single quote resulting in for example:
FOO = some ' single ' quotes BAR = $(subst ', '\'', $(FOO)) @echo "$(BAR)" some '\'' single '\'' quotes
Same goes for single double quotes as well as things like:
BAR = $(subst ", \", $(FOO)) BAR = "$(subst ", \", $(FOO))"
make.vim syntax file matches single quoted strings by:
syn region makeSString start=+\(\\\)\@<!'+ skip=+\\.+ end=+'+ contains=makeIdent
/usr/share/vim/vim74/syntax/make.vimor the like.
But this does not match single standalone quotes, and the syntax comes out of sync and one get a mess on the lines following.
I am not fluent in syn commands. As a quick hack I have added the file
.vim/after/syntax/make.vim with the contents:
syn region makeQarg start=#"\?\$(subst\s\+\(['"]\)\@=#hs=e+1 end=+['"]+ hi def link makeQarg Exception
Error or the like for hi def link if you want to twiddle.)
This is not a fix. One issue is that the keyword
subst and the leading
$( also becomes a part of the match and thus one loose the syntax for that. Not a huge deal, but still.
Any suggestions on a fix?