p00f/nvim-ts-rainbow

Color orders are not matching with the specified ones

HoneyBearCodes opened this issue · 3 comments

Description of the Bug 🪲

When I added the hex colors to the colors dictionary. After launching the neovim with a JavaScript file, I see that inside that JavaScript file, the order in which colors are applied is different from the order in which I specified them. And this is only happening with JavaScript files, on other files, it's working fine.

Steps to reproduce 🤰🏻

After installing the plugin, I added the following to the rainbow dictionary:

rainbow = {
	enable = true,
	extended_mode = true,
	max_file_lines = nil,
	colors = {
              "#bd93f9",
              "#ffb86c",
              "#ff79c6",
              "#50fa7b",
              "#f1fa8c",
              "#8be9fd"
    }
}

Snippets of the code with strange behaior 🧑🏻‍💻

const express = require('express');
const cookieSession = require('cookie-session');
const authRouter = require('./routes/admin/auth');
const adminProductsRouter = require('./routes/admin/products');
const productsRouter = require('./routes/products');
const cartsRouter = require('./routes/carts');

const app = express();
const PORT = 3000;

app.use(express.static('public'));
app.use(express.urlencoded({ extended: true }));
app.use(
  cookieSession({
    keys: ['falkjq54@^$34lja)(**&HKJH8643'],
  })
);

app.use(authRouter);
app.use(adminProductsRouter);
app.use(productsRouter);
app.use(cartsRouter);

app.listen(PORT, () => {
  console.log(`[+] Listening on port ${PORT}`);
});

Expected behavior 🤞🏻

I want it to apply the colors on the braces/brackets/parantheses in the order that I specified in the colors dictionary.

Screenshots 🖼️

helpMe

p00f commented

#33

I could fix your particular issue but I don't know js so it might make it worse for other cases. Someone who knows js needs to contribute to colors.lua

p00f commented

So i copied ecma to js, let's see what happens. Should be fixed now @AmaaelTyrneaMitore

Oh my god! Thanks a looottt!!! @p00f 😍. That was really fast! I just love community (and the author) here!