folke / tokyonight.nvim

🏙 A clean, dark Neovim theme written in Lua, with support for lsp, treesitter and lots of plugins. Includes additional themes for Kitty, Alacritty, iTerm and Fish.
Apache License 2.0
6.42k stars 433 forks source link

bug: Lualine colors broken after recent change #551

Closed BrendanArmstrong1 closed 4 months ago

BrendanArmstrong1 commented 4 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.0

Operating system/version

Linux arch 6.9.1-arch1-1

Describe the bug

after recently updateing the tokyonight plugin, the color on the lualine go away, by setting the commit hash to 096543e112744eb94947cc3c5a916fff1deea2f0, the color comes back.

Original image

New version image

Steps To Reproduce

  1. update tokyonight
  2. ???
  3. profit

Expected Behavior

amazing colors from tokyonight

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 = {
  "folke/tokyonight.nvim",
  "folke/tokyonight.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
stefanlogue commented 4 months ago

Same issue for me, nvim 0.10, macOS 14.3

WebDeveloperBen commented 4 months ago

since the recent update, my rather basic tokyonight config broke and I found the issue was resolved by commenting out the sidebars line as shown

Screenshot 2024-07-02 at 11 41 31 PM
stefanlogue commented 4 months ago

since the recent update, my rather basic tokyonight config broke and I found the issue was resolved by commenting out the sidebars line as shown

Screenshot 2024-07-02 at 11 41 31 PM

Mine was "fixed" by specifying a commit to target in my lazy config, one before these changes were made

skela commented 4 months ago

2024-07-02_16-03 2024-07-02_16-02

Yeah I've the same issue, @stefanlogue you wouldnt happen to have that commit for us :P Miss having my transparent sidebar.

stefanlogue commented 4 months ago

Sure thing @skela, it's "096543e112744eb94947cc3c5a916fff1deea2f0"

stefanlogue commented 4 months ago
Screenshot 2024-07-02 at 16 52 37

I don't think this is fixed, I'm still getting the same issue as before the fix. See the bottom right section and bottom left

folke commented 4 months ago

It works fine for me, so can you please provide a correct repro?

samtgarson commented 4 months ago

@folke I can confirm that using the following repro.lua lualine has no colours, and tagging tokyonight to the SHA mentioned above it works as expected.

-- 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 = {
  { "folke/tokyonight.nvim" },
  {
    "nvim-lualine/lualine.nvim",
    opts = {
      options = { theme = 'tokyonight' }
    }
  }
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
❯ nvim -v
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
folke commented 4 months ago

Thanks, will check

folke commented 4 months ago

set the lualine theme to auto for now. That works. or tokyonight-moon

AThePeanut4 commented 4 months ago

@folke It happens because of the theme = 'tokyonight' - with theme = 'tokyonight-storm', etc it works correctly.

And the reason it doesn't work is because lualine does pairs over the theme table here, which is incompatible with the metatable __index caching in lua/lualine/themes/tokyonight.lua.

The easiest fix would probably be to directly return the get() function from a _tokyonight.lua file, and then have tokyonight.lua just be return require("lualine.themes._tokyonight")()

folke commented 4 months ago

Good suggestion. Fixed!