diff --git a/config/lua/ivy/config/options.lua b/config/lua/ivy/config/options.lua index 9f1d723..288a484 100644 --- a/config/lua/ivy/config/options.lua +++ b/config/lua/ivy/config/options.lua @@ -255,8 +255,8 @@ local function setfolds() end local foldgroup = vim.augroup("@ivy.folds.init", true) -foldgroup("BufWinEnter", function(ev) - vim.api.nvim_buf_call(ev.buf, setfolds) +foldgroup({ "BufWinEnter", "VimEnter" }, function(ev) + vim.api.nvim_buf_call(ev.buf or 0, setfolds) end) foldgroup("OptionSet", { pattern = "buftype" }, function(ev) vim.api.nvim_buf_call(ev.buf, setfolds) diff --git a/config/plugin/statuscolumn.lua b/config/plugin/statuscolumn.lua deleted file mode 100644 index 2ceb30f..0000000 --- a/config/plugin/statuscolumn.lua +++ /dev/null @@ -1,47 +0,0 @@ -if vim.g.loaded_statuscolumn then - return -end - -vim.g.loaded_statuscolumn = true - -local function hl(name, str) - return string.format("%%#%s#%s%%*", name, str) -end - -function _G.statuscolumn() - local num = "%l" - - ---@type string? - local foldstr - - if vim.v.virtnum == -1 then - num = " " - elseif vim.v.virtnum > 0 then - num = "|" - end - - if vim.fn.foldclosed(vim.v.lnum) == vim.v.lnum then - num = ">" - elseif vim.fn.foldlevel(vim.v.lnum) > 0 then - foldstr = "│" - end - - -- apply highlights ========================================================== - - local cursorlinenr_enabled = vim.o.cursorline - and (vim.o.cursorlineopt == "both" or vim.o.cursorlineopt == "number") - - local linenrhl = "LineNr" - if - cursorlinenr_enabled and vim.v.lnum == vim.api.nvim_win_get_cursor(0)[1] - then - linenrhl = "CursorLineNr" - end - - num = hl(linenrhl, num) - foldstr = foldstr and hl("NonText", foldstr) or nil - - return "%s" .. (vim.wo.number and num or "") .. (foldstr or " ") -end - -vim.o.statuscolumn = "%{%v:lua.statuscolumn()%}"