From 7fc58d5aaa880e2cdabf790a36cb3ce125353e98 Mon Sep 17 00:00:00 2001
From: Pau Garcia Chiner <49660697+pauchiner@users.noreply.github.com>
Date: Wed, 14 Feb 2024 10:11:57 +0100
Subject: [PATCH] feat(theme): add a _load function on the init to load
 different variants

---
 lua/pastelnight/init.lua | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lua/pastelnight/init.lua b/lua/pastelnight/init.lua
index 801059f..8bd58dd 100644
--- a/lua/pastelnight/init.lua
+++ b/lua/pastelnight/init.lua
@@ -4,6 +4,18 @@ local config = require('pastelnight.config')
 
 local M = {}
 
+function M._load(style)
+  if style and not M._style then
+    M._style = require("pastelnight.config").options.style
+  end
+  if not style and M._style then
+    ---@diagnostic disable-next-line: inject-field
+    require("pastelnight.config").options.style = M._style
+    M._style = nil
+  end
+  M.load({ style = style, use_background = style == nil })
+end
+
 ---@param opts Config|nil
 function M.load(opts)
   if opts then