diff options
| author | christianchiarulli <chrisatmachine@gmail.com> | 2021-12-20 10:57:40 -0500 |
|---|---|---|
| committer | christianchiarulli <chrisatmachine@gmail.com> | 2021-12-20 10:57:40 -0500 |
| commit | 68de5d4fab1cd11d74829947a2809c1899280dea (patch) | |
| tree | f8cb1ff76ffa523f10ab00ade520b8bf237edf82 /lua | |
| parent | 67f73b704498322cfbc79315f4ee9761f630b464 (diff) | |
use lua way to handle color scheme errors
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/user/colorscheme.lua | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lua/user/colorscheme.lua b/lua/user/colorscheme.lua index b1e21f6..8c73fd6 100644 --- a/lua/user/colorscheme.lua +++ b/lua/user/colorscheme.lua @@ -1,8 +1,7 @@ -vim.cmd [[ -try - colorscheme darkplus -catch /^Vim\%((\a\+)\)\=:E185/ - colorscheme default - set background=dark -endtry -]] +local colorscheme = "default" + +local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) +if not status_ok then + vim.notify("colorscheme " .. colorscheme .. " not found!") + return +end |
