Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cloudUser98 opened this issue Jul 6, 2023 · 6 comments
Open

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

cloudUser98 opened this issue Jul 6, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@cloudUser98
Copy link

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 cloudUser98 added the bug Something isn't working label Jul 6, 2023
@cmattinson
Copy link

@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
Copy link

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
Copy link

enzime4u commented Jan 5, 2024

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
Copy link
Owner

EdenEast commented Jan 5, 2024

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
Copy link

enzime4u commented Jan 5, 2024

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

@EdenEast
Copy link
Owner

EdenEast commented Jan 8, 2024

This is inherited from

["@tag.attribute"] = { fg = syn.func, style = "italic" }, -- Tags like html tag names.

You can override this by removing the style:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants