olimorris / onedarkpro.nvim

🎨 Atom's iconic One Dark theme. Cacheable, fully customisable, Tree-sitter and LSP semantic token support. Comes with variants
MIT License
815 stars 46 forks source link

[Bug]: onedark_dark floating panels indistinguishable #220

Closed vincentole closed 10 months ago

vincentole commented 10 months ago

Your minimal.lua config

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", "--single-branch", "https://github.com/folke/lazy.nvim.git", lazypath, }) end vim.opt.runtimepath:prepend(lazypath)

-- install plugins local plugins = { { "olimorris/onedarkpro.nvim", opts = { -- Your OneDarkPro config goes here }, config = true },

{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },

-- Delete if you do not require LSP { "VonHeikemen/lsp-zero.nvim", branch = "v2.x", dependencies = { -- LSP Support {"neovim/nvim-lspconfig"}, -- Required { -- Optional "williamboman/mason.nvim", build = function() pcall(vim.cmd, "MasonUpdate") end, }, {"williamboman/mason-lspconfig.nvim"}, -- Optional

  -- Autocompletion
  {"hrsh7th/nvim-cmp"},     -- Required
  {"hrsh7th/cmp-nvim-lsp"}, -- Required
  {"L3MON4D3/LuaSnip"},     -- Required
},
config = function()
  local lsp = require("lsp-zero").preset({})

  lsp.on_attach(function(client, bufnr)
    lsp.default_keymaps({buffer = bufnr})
  end)

  lsp.ensure_installed({ "lua_ls" })

  -- (Optional) Configure lua language server for neovim
  require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls())

  lsp.setup()
end

}

-- add any other plugins here }

require("lazy").setup(plugins, { root = root .. "/plugins", })

-- setup treesitter local ok, treesitter = pcall(require, "nvim-treesitter.configs") if ok then treesitter.setup({ ensure_installed = "all", ignore_install = { "phpdoc" }, -- list of parser which cause issues or crashes highlight = { enable = true }, }) end

vim.cmd("colorscheme onedark_dark")

Error messages

No error message

Describe the bug

Using the onedark_dark theme, I expect:

The following line might be a problem: https://github.com/olimorris/onedarkpro.nvim/blob/44badbaa1c4408679adc6b6979b669540db3fb46/lua/onedarkpro/themes/onedark_dark.lua#L37C2-L37C2

Reproduce the bug

Use the minimal config above. Open Mason: the bg is black Write vim. in the config file, which should open the autocomplete and start tapping: No highlight applied to the selected item

Final checks

olimorris commented 10 months ago

Hey @vincentole thanks for the report. Could you share a screenshot?

vincentole commented 10 months ago

Note that is switched back to my old config (which you see on the screenshot), but I used the minimal one before.

Screenshot from 2024-01-14 23-51-45

image

If this is a problem for me only. Is it possible that kitty interferes somehow?

These are my kitty and nvim configs, just in case: https://github.com/vincentole/kitty https://github.com/vincentole/nvim

olimorris commented 10 months ago

I should have asked what happens when you overwrite the float_bg highlight group:

require("onedarkpro").setup({
  colors = {
    darker_bg = "require('onedarkpro.helpers').lighten('bg', 5, 'onedark_dark')",
  },
  highlights = {
    float_bg = { fg = "${darker_bg}" }
  }
})

I would expect that to make the background lighter for float windows.

vincentole commented 10 months ago

Unfortunately, nothing changes.

I added the snippet like this: Screenshot from 2024-01-15 14-57-57

olimorris commented 10 months ago

Sorry, I messed it up. Try this:

require("onedarkpro").setup({
  colors = {
    float_bg = "require('onedarkpro.helpers').lighten('bg', 5, 'onedark_dark')",
  },
  highlights = {
    NormalFloat = { fg = "${float_bg}" }
  }
})

You'll need to change the values for float_bg and decide whether you wish to lighten or darken the colors.

vincentole commented 10 months ago

With a slight tweak it works, changing fg to bg:

require("onedarkpro").setup({
  colors = {
    float_bg = "require('onedarkpro.helpers').lighten('bg', 5, 'onedark_dark')",
  },
  highlights = {
    NormalFloat = { bg = "${float_bg}" }
  }
})

Thanks for the help! Would be great to have something like this out of the box :) And thanks for your work on this theme, its very cool :)

olimorris commented 10 months ago

Could you share a screenshot of how it looks after your tweaks? I'd be happy to update the default settings

vincentole commented 10 months ago

Sure, I used the lualine setting of 5.3. I not sure if the contrast is enough for long hours, but I like it for now.

Screenshot from 2024-01-16 17-43-54