[patch] Add 'removeattrs' argument to :syntax command. Enhancement to 'modifier' patch.
- This is a potential enhancement to 'syn-modifier' for your consideration.
It adds 'syn-removeattrs', which can be used as follows:
syntax region Bold start='\*' end='\*' contains=Unbold
syntax region Unbold start='\~' end='\~' removeattrs
highlight Bold term=bold
highlight Unbold term=bold
*this is bold ~this is not~*
It's a logical extension of 'syn-modifier': if there's a way to turn attrs on without affecting other highlighting there should probably be a way to turn them off.
I'm not thrilled about the naming or the implementation, though. A lot of the hl_combine_attrs code was copied with lots tiny changes to merge with flag1 & ~flag2 instead of flag1 | flag2. A fairly significant refactor would be needed to reduce the repetition.
I'm also not thrilled about the syntax, it's confusing to "highlight Unbold term=bold" and have it remove bold.
I'm open to suggestions. Regardless, I think 'syntax modifier' stands on its own.
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