I've been trying to get delimitMate to not match the '
in a lifetime, so you end up with something like &'a'
. In the Rust syntax file, I can see lifetimes are defined with two (?) regions:
" For the benefit of delimitMate
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u{\x\{1,6}}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
I then tried to add each of these to the delimitMate_excluded_regions
option:
au FileType rust let b:delimitMate_excluded_regions="rustGenericLifetimeCandidate"
I tried with both of the regions defined in the syntax file, but neither make a difference to how delimitMate acts.
Has anyone managed to get this to work / what am I doing wrong here?