Parcourir la source

use palettes when available for a colorscheme

christianchiarulli il y a 4 ans
Parent
commit
95190e9c34
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6 2
      lua/lv-galaxyline/init.lua

+ 6 - 2
lua/lv-galaxyline/init.lua

@@ -5,8 +5,12 @@ local status_ok, gl = pcall(require, "galaxyline")
 if not status_ok then
 if not status_ok then
   return
   return
 end
 end
--- get my theme in galaxyline repo
-local colors = O.plugin.galaxyline.colors
+
+-- NOTE: if someone defines colors but doesn't have them then this will break
+local palette_status_ok, colors = pcall(require, O.colorscheme .. ".palette")
+if not palette_status_ok then
+  colors = O.plugin.galaxyline.colors
+end
 
 
 local condition = require "galaxyline.condition"
 local condition = require "galaxyline.condition"
 local gls = gl.section
 local gls = gl.section