nightfox.nvim icon indicating copy to clipboard operation
nightfox.nvim copied to clipboard

bug: Can't disable italics for React components properties

Open cloudUser98 opened this issue 1 year ago • 7 comments

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")

cloudUser98 avatar Jul 06 '23 17:07 cloudUser98

@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")

cmattinson avatar Jul 18 '23 20:07 cmattinson

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")

pipoprods avatar Jul 20 '23 09:07 pipoprods

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

enzime4u avatar Jan 05 '24 17:01 enzime4u

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?

EdenEast avatar Jan 05 '24 20:01 EdenEast

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

enzime4u avatar Jan 05 '24 20:01 enzime4u

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" },
    },
  },
})

EdenEast avatar Jan 08 '24 14:01 EdenEast