From 62f688262149816eb0ed5c020091eff655fec24d Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Fri, 19 Sep 2025 23:49:16 -0400 Subject: [PATCH] Fix quirks --- .../lua/plugins/omarchy-theme-hotreload.lua | 35 ++++++++----------- themes/tokyo-night/neovim.lua | 2 +- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/config/nvim/lua/plugins/omarchy-theme-hotreload.lua b/config/nvim/lua/plugins/omarchy-theme-hotreload.lua index 7bbdef40..8d05a5b8 100644 --- a/config/nvim/lua/plugins/omarchy-theme-hotreload.lua +++ b/config/nvim/lua/plugins/omarchy-theme-hotreload.lua @@ -5,44 +5,39 @@ return { lazy = false, priority = 1000, config = function() - -- Cache the transparency file path local transparency_file = vim.fn.stdpath("config") .. "/plugin/after/transparency.lua" - local has_transparency = vim.fn.filereadable(transparency_file) == 1 vim.api.nvim_create_autocmd("User", { pattern = "LazyReload", callback = function() package.loaded["plugins.theme"] = nil - local ok, theme_spec = pcall(require, "plugins.theme") - if ok and theme_spec then + vim.schedule(function() + local ok, theme_spec = pcall(require, "plugins.theme") + if not ok then + return + end + for _, spec in ipairs(theme_spec) do if spec[1] == "LazyVim/LazyVim" and spec.opts and spec.opts.colorscheme then local colorscheme = spec.opts.colorscheme + require("lazy.core.loader").colorscheme(colorscheme) + vim.defer_fn(function() - local colorscheme_available = - vim.tbl_contains(vim.fn.getcompletion("", "color"), colorscheme) + pcall(vim.cmd.colorscheme, colorscheme) - if not colorscheme_available then - require("lazy.core.loader").colorscheme(colorscheme) + if vim.fn.filereadable(transparency_file) == 1 then + vim.defer_fn(function() + vim.cmd.source(transparency_file) + end, 5) end - - local success = pcall(vim.cmd.colorscheme, colorscheme) - - if success then - if has_transparency then - vim.defer_fn(function() - vim.cmd.source(transparency_file) - end, 1) - end - end - end, 0) + end, 5) break end end - end + end) end, }) end, diff --git a/themes/tokyo-night/neovim.lua b/themes/tokyo-night/neovim.lua index d877060d..39327c9b 100644 --- a/themes/tokyo-night/neovim.lua +++ b/themes/tokyo-night/neovim.lua @@ -6,7 +6,7 @@ return { { "LazyVim/LazyVim", opts = { - colorscheme = "tokyonight", + colorscheme = "tokyonight-night", }, }, }