Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] vim-rainbow breaks vim-polyglot jinja2 highlighting #135

Open
horseinthesky opened this issue Dec 17, 2019 · 5 comments
Open

[Bug] vim-rainbow breaks vim-polyglot jinja2 highlighting #135

horseinthesky opened this issue Dec 17, 2019 · 5 comments

Comments

@horseinthesky
Copy link

horseinthesky commented Dec 17, 2019

Describe the bug

When vim-rainbow plugin is active it breaks jinja2 highlighting done by vim-polyglot.

To Reproduce

Put

Plug 'luochen1990/rainbow'
Plug 'sheerun/vim-polyglot'

let g:rainbow_active = 1

to your vimrc file.

Open login.j2 file:

            <login>
                <class>
                    <name>mon</name>
                    <permissions>secret</permissions>
                    <permissions>view</permissions>
                    <permissions>view-configuration</permissions>
                    <allow-commands>ping*|trace*|show*</allow-commands>
                </class>
                {% for user in users %}
                <user>
                    <name>{{ user.name }}</name>
                    {% if user.uid is defined %}
                    <uid>{{ user.uid }}</uid>
                    {% endif %}
                    <class>{{ user.class | default("super-user") }}</class>
                    <authentication>
                        {% if user.pass is defined %}
                        <encrypted-password>{{ user.pass }}</encrypted-password>
                        {% endif %}
                        {% if user.ssh_keys is defined %}
                        {% for key in user.ssh_keys %}
                        <ssh-rsa>
                            <name>ssh-rsa {{ key }}</name>
                        </ssh-rsa>
                        {% endfor %}
                        {% endif %}
                    </authentication>
                </user>
                {% endfor %}
            </login>

Check filetype with :set ft?. It'll show filetype=jinja2.

It will look like this:
image

Do :RainbowToggle.

Now it will look like this:
image

@luochen1990
Copy link
Owner

What's your expecting result? Do you just want to disable rainbow for this file type or you want rainbow to highlight the parentheses inside {% %} or you want to highlight the tags outside the {% %}?

@horseinthesky
Copy link
Author

What's your expecting result? Do you just want to disable rainbow for this file type or you want rainbow to highlight the parentheses inside {% %} or you want to highlight the tags outside the {% %}?

Expecting result is certainly not breaking syntax highlighting.
I think the correct behavior is to highlight the parentheses inside {% %} as it is the main idea of this plugin.

@smemsh
Copy link

smemsh commented Dec 7, 2024

vim highlights jinja itself now with its own runtimes, without need for polyglot. So the "confliction with other third-party syntax plugins" tag can now be removed @luochen1990

even still, rainbow continues to break jinja highlighting today.

@smemsh
Copy link

smemsh commented Dec 7, 2024

@horseinthesky it's not completed though, still broke. it works for you?

@horseinthesky
Copy link
Author

@horseinthesky it's not completed though, still broke. it works for you?

Sorry. It's been 5 years. Not using the plugin. Reopen though.

@horseinthesky horseinthesky reopened this Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants