Skip to content

Commit

Permalink
Merge branch 'main' into refactor/config.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Aug 16, 2021
2 parents a0a5bc7 + 5a31d77 commit 9fe4e90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add proper `Description` inside `konsole` theme (bug from #33)
- Lualine `normal` section background color set blue color #43
- Kitty window border colors fix #47
- refactored `lua/github-theme/config.lua`

## [v0.0.1] - 9 Jul 2021

Expand Down
23 changes: 5 additions & 18 deletions lua/github-theme/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@ local config

-- shim vim for kitty and other generators
vim = vim or {g = {}, o = {}}
vim.g.githubThemeStyle = "dark"

-- @return string
local function getThemeStyle()
if vim.g.githubThemeStyle == nil then
return config.themeStyle
else
return vim.g.githubThemeStyle
end
end
vim.g.github_theme_style = "dark"

config = {
themeStyle = getThemeStyle(),
themeStyle = vim.g.github_theme_style,
transparent = false,
commentStyle = "italic",
keywordStyle = "italic",
Expand All @@ -37,9 +29,8 @@ local function applyConfiguration(userConfig)
if value ~= nil then
if config[key] ~= nil then
config[key] = value
-- useful for `lualine`
if key == "themeStyle" and value ~= vim.g.githubThemeStyle then
vim.g.githubThemeStyle = value
if key == "themeStyle" and value ~= vim.g.github_theme_style then
vim.g.github_theme_style = value
end
else
error("projekt0n/github-nvim-theme: Option " .. key .. " does not exist") -- luacheck: ignore
Expand All @@ -48,8 +39,4 @@ local function applyConfiguration(userConfig)
end
end

return {
config = config,
applyConfiguration = applyConfiguration,
getThemeStyle = getThemeStyle
}
return {config = config, applyConfiguration = applyConfiguration}
2 changes: 0 additions & 2 deletions lua/lualine/themes/github.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
local configModule = require("github-theme.config")

local config = configModule.config
config.themeStyle = configModule.getThemeStyle()

local colors = require("github-theme.colors").setup(config)

return {
Expand Down

0 comments on commit 9fe4e90

Please sign in to comment.