Skip to content

Commit

Permalink
shorter read/write of THEME_DOTFILE
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Jan 24, 2025
1 parent 155e5de commit 62ee3ad
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Layout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,7 @@ function read_theme_dotfile() :: Union{Symbol,Nothing}
end

try
Symbol(open(THEME_DOTFILE, "r") do file
read(file, String)
end)
read(THEME_DOTFILE, String) |> Symbol
catch
nothing
end
Expand All @@ -670,11 +668,8 @@ end

function write_theme_dotfile(theme::Symbol)
isfile(THEME_DOTFILE) || return

open(THEME_DOTFILE, "w") do file
write(file, string(theme))
end


write(THEME_DOTFILE, String(theme))
nothing
end

Expand Down

0 comments on commit 62ee3ad

Please sign in to comment.