I’d like to highlight conflict markers (“<<<<<<< HEAD”, “=======”, …) across all file types.
I created a small bundle with an injection grammar for this, but it only works correctly for plain text. It seems that in most source grammars other rules take precedence (e.g. in Ruby “=======” has the scope “keyword.operator.assignment.ruby”) and therefore the injection grammar won’t get applied.
Is there any way to solve this?
Stefan
On 7 Feb 2014, at 18:34, Stefan Daschek wrote:
[…] It seems that in most source grammars other rules take precedence (e.g. in Ruby “=======” has the scope “keyword.operator.assignment.ruby”) and therefore the injection grammar won’t get applied.
Is there any way to solve this?
We abuse the “left scope match” syntax to indicate that we want the injected rules matched before the rules in the context they are being injected into.
This means you should be able to make it work by using a scope selector of L:(source, text) or simply L:*
Though I have tested neither, so let me know if it does not work.
[…] It seems that in most source grammars other rules take precedence (e.g. in Ruby “=======” has the scope “keyword.operator.assignment.ruby”) and therefore the injection grammar won’t get applied.
Is there any way to solve this?
We abuse the “left scope match” syntax to indicate that we want the injected rules matched before the rules in the context they are being injected into.
This means you should be able to make it work by using a scope selector of L:(source, text) or simply L:*
Works great, thanks!
If anyone is interested, the bundle is on GitHub: https://github.com/noniq/Merge-Markers.tmbundle
Stefan
On 10 Feb 2014, at 17:23, Stefan Daschek wrote:
If anyone is interested, the bundle is on GitHub: https://github.com/noniq/Merge-Markers.tmbundle
Thanks, we added it to the bundle index so it can now be installed via Preferences → Bundles.