Skip to content

Commit

Permalink
fix(options): add error reporting to malformed user options
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Apr 1, 2024
1 parent c2e15ee commit d9eb52d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lua/astronvim/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@ vim.opt.virtualedit = "block" -- allow going past end of line in visual block mo
vim.opt.wrap = false -- disable wrapping of lines longer than the width of window
vim.opt.writebackup = false -- disable making a backup before overwriting a file

pcall(vim.g.astronvim_options)
pcall(require, "config.options")
if type(vim.g.astronvim_options) == "function" then vim.g.astronvim_options() end

local user_opts = "config.options"
local user_opts_loaded, user_opts_result = pcall(require, user_opts)
if not user_opts_loaded and #require("lazy.core.cache").find(user_opts) > 0 then
vim.api.nvim_err_writeln("Failed to load " .. user_opts_loaded .. "\n\n" .. user_opts_result)
end

0 comments on commit d9eb52d

Please sign in to comment.