neovim configuration using rocks.nvim plugin manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(core): prevent infinite loop on `:colorschme`

+12 -7
+3 -2
lua/core/autocmds.lua
··· 112 112 113 113 au("ColorScheme", { 114 114 group = aug("user_colorscheme"), 115 - callback = function (ev) 115 + -- NOTE: wrap with schedule to prevent require loop 116 + callback = vim.schedule_wrap(function (ev) 116 117 local tbl = require("core.highlights") 117 118 local callback = tbl[ev.match] 118 119 if callback then 119 120 callback() 120 121 end 121 - end, 122 + end), 122 123 }) 123 124 124 125 if vim.o.inccommand == "split" then
+9 -5
lua/core/highlights.lua
··· 1 - local util_hl = require("utils.highlights") 1 + -- stylua: ignore start 2 + local util_hl = function() return require("utils.highlights") end 3 + -- stylua: ignore end 2 4 3 5 pcall(vim.cmd.colorscheme, "github_dark_default") 4 6 ··· 13 15 ]] 14 16 15 17 -- colorscheme callback map used from core.autocmds 16 - return { 17 - ["github_dark_default"] = function () 18 - util_hl.set("StatusLineNC", { reverse = true, inherit = "StatusLine" }) 18 + local tbl = { 19 + ["github_dark_default"] = function() 20 + util_hl().set("StatusLineNC", { reverse = true, inherit = "StatusLine" }) 19 21 -- util_hl.set("StatusLine", { bold = true }) 20 22 -- local sep = util_hl.tint(util_hl.get("WinBar", "fg"), -0.25) 21 23 -- util_hl.set("WinBar", { reverse = true }) 22 24 -- util_hl.set("WinBarNC", { fg = sep, reverse = true }) 23 25 -- util_hl.set("WinSeparator", { fg = sep }) 24 - end 26 + end, 25 27 } 28 + 29 + return tbl