EdenEast / nightfox.nvim

🦊A highly customizable theme for vim and neovim with support for lsp, treesitter and a variety of plugins.
MIT License
2.91k stars 136 forks source link

bug: Can't disable italics for React components properties #361

Open cloudUser98 opened 1 year ago

cloudUser98 commented 1 year ago

Neovim version (nvim -v)

0.8.3

Operating system/version

Fedora 36

Describe the bug

I have the default config options for the colorscheme, but i am not being able to disable the italics style for the properties in the react components with javascript.

image image

Steps To Reproduce

  1. Install nightfox using Packer
  2. Install treesitter
  3. Create a react component with properties

Expected Behavior

Not having styles at all on my syntax

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 = {
  {
    "EdenEast/nightfox.nvim",
    config = function()
      require("nightfox").setup({
        -- setup here ...
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("nightfox")
cmattinson commented 11 months ago

@cloudUser98 I just installed this theme and encountered this issue as well (on Mac, using Packer). JSX props look to be tied to the @tag.attribute highlight group, you can get around this temporarily by adding an override in your "after" config folder, e.g. "after/plugin/nightfox.lua"

vim.cmd("highlight @tag.attribute gui=NONE cterm=NONE")

pipoprods commented 11 months ago

The same bug applies to fenced_code_block in markdown files.

Adapted the workaround suggested by @cmattinson :

vim.cmd("highlight @text.literal.block.markdown gui=NONE cterm=NONE")

enzime4u commented 6 months ago

I have the same bug for react code ! How can I disable the italics for the React components attributes , I tried to style them but is not working !

Screenshot 2024-01-05 at 17 10 49

EdenEast commented 6 months ago

Can you tell me the highlight group being applied? If you are using 0.9+ put your cursor over the target area and use :Inspect. What is the result of this?

enzime4u commented 6 months ago

I hope this helps : Screenshot 2024-01-05 at 20 45 01

EdenEast commented 6 months ago

This is inherited from

https://github.com/EdenEast/nightfox.nvim/blob/34542a433e5bd03c27b6cd4570849d9cde59acf7/lua/nightfox/group/modules/treesitter.lua#L114

You can override this by removing the style:

require("nightfox").setup({
  groups = {
    all = {
      ["@tag.attribute"] = { fg = "func" },
    },
  },
})