craftzdog / solarized-osaka.nvim

🏯 A clean, dark Neovim theme written in Lua, with support for lsp, treesitter and lots of plugins.
Apache License 2.0
650 stars 29 forks source link

bug: Incorrect colors on .jsx files. #24

Closed Redoxahmii closed 6 months ago

Redoxahmii commented 6 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10

Operating system/version

Arch Linux

Describe the bug

The colors are not properly working for the html tags which you can see from the image below:

Screenshot from 2024-03-05 04-13-29

On a .tsx files this issue goes away.

Steps To Reproduce

  1. Create a .jsx file
  2. Open

Expected Behavior

The colors should be consistent as they are when using .tsx format but instead are not working properly.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "craftzdog/solarized-osaka.nvim",
  "craftzdog/solarized-osaka.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("solarized-osaka")
-- add anything else here
Redoxahmii commented 6 months ago

created a pull which fixes this.

craftzdog commented 6 months ago

I don't see the same issue in <> colors in JSX 🤔

Screenshot 2024-03-06 at 23 43 04

Treesitter
  - @operator.javascript links to @operator javascript
  - @tag.delimiter.javascript links to Special javascript
Redoxahmii commented 6 months ago

I did test this on v0.9.5 and and currentl on nightly build v0.10.0 and for me it shows like this. I do not have another system on which i could test this.

craftzdog commented 6 months ago

Can you share what the Inspect output looks like? Mine is:

Screenshot 2024-03-07 at 15 32 55

In my case, @tag.delimiter.javascript is applied to the angle brackets. This theme has Special = { fg = c.orange500 }, so they are orange. Can you check javascript is installed properly? Run TSInstallInfo.

As you know, tokyonight doesn't have @tag.delimiter.javascript. So, I don't understand why it is necessary on this theme.

Redoxahmii commented 6 months ago

Screenshot from 2024-03-07 19-28-39

For me it also outputs the same but the colors are evident as they are. This occurs only in jsx and html files but in tsx it correctly uses the right colors. I have tested on a clean build of LazyVim too without any of my configuration and the results stay the same. Explicitly specifying it might make it a better solution so there are not any edge cases.

Redoxahmii commented 6 months ago

These screenshots on this PR also show the same issue occurs in Vue as well and is not something that is occurring on only my setup.