HiPhish / rainbow-delimiters.nvim

Rainbow delimiters for Neovim with Tree-sitter
https://gitlab.com/HiPhish/rainbow-delimiters.nvim
Apache License 2.0
533 stars 39 forks source link

[Bug]: does not work when golang code contains regex pattern #32

Closed gasuketsu closed 1 year ago

gasuketsu commented 1 year ago

Neovim version

0.9.1

Language affected

Go

Query

No response

Strategy

Global

Description

Thank you for excellent plugin.

I found that Rainbow-delimiters does not work when golang source file contains regex pattern. I am not sure if this issue can be reproduced in other language code.

Following is sample code to reproduce this issue.

package main

import (
    "fmt"
    "regexp"
)

var re = regexp.MustCompile(`(\D*)(\d+)`)

func main() {
    fmt.Println("Hello, world")
}
HiPhish commented 1 year ago

For me the problem is not the pattern but the regexp module. If I change the name (even to something invalid) the highlighting works again. Does it work for you?

It looks like the term node is breaking highlighting. Even if I reduce the pattern some a single character like x I get same result.

HiPhish commented 1 year ago

OK, I think I have found it: you probably have the regex grammar installed, right? Try uninstalling it and tell me if highlighting works then.

HiPhish commented 1 year ago

Looks like the name of a node has changed in the regex grammar. Please try the current master again and report back if the issue is resolved.

gasuketsu commented 1 year ago

@HiPhish Yes you are right, I have regex grammer installed, and now works fine with current master. Thanks for quick fix!