Skip to content

Commit

Permalink
darkmode fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
David O'Trakoun committed Oct 16, 2024
1 parent 0a25333 commit 8227894
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nvim/lua/dko/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ local colorscheme_file_path = ("%s/wezterm-colorscheme.txt"):format(
)
M.apply_from_file = function()
-- see ./bench/readfile.lua - io.input was consistently fastest for me
local _, file = pcall(io.input, colorscheme_file_path)
M[(file and (file:lines()()) or "dark") .. "mode"]()
local ok, file = pcall(io.input, colorscheme_file_path)
if ok then
M[(file and (file:lines()()) or "dark") .. "mode"]()
else
M.darkmode()
end
end

local colorscheme_handle = nil
Expand Down

0 comments on commit 8227894

Please sign in to comment.