-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecated: Configuration using
vim.g.github_*
removed.
This commit includes the removal of all supportive modules from the Vim configuration that were using `vim.g.github_*`. Please migrate to the `setup` Lua function. Updated documentation can be found in the README. Additionally, a new library called `deprecation` has been added for writing deprecation warning messages. For further information about the deprecated modules and their replacements, please refer to the `:h github-theme.deprecated` documentation.
- Loading branch information
Showing
11 changed files
with
193 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
*gt_deprecated.txt* github-nvim-theme | ||
|
||
GITHUB NVIM THEME DEPRECATION REFRENCE | ||
|
||
github-nvim-theme *github-theme.deprecated* | ||
|
||
The items listed below are deprecated: they will be removed in the future. | ||
They should not be used in new scripts, and old scripts should be updated. | ||
|
||
============================================================================== | ||
Deprecated features | ||
|
||
|
||
MODULES | ||
- *'config.vim_config'* Deprecated. | ||
- *'config.default'* Moved to |'github-theme.config'| | ||
module and accessed with |'default'| variable. | ||
|
||
GLOBAL OPTIONS | ||
- *'vim.g.github_theme_style'* Use |setup| Lua function instead. | ||
- *'vim.g.github_colors'* Use |setup| Lua function instead. | ||
- *'vim.g.github_overrides'* Use |setup| Lua function instead. | ||
- *'vim.g.github_dark_float'* Use |setup| Lua function instead. | ||
- *'vim.g.github_dark_sidebar'* Use |setup| Lua function instead. | ||
- *'vim.g.github_sidebars'* Use |setup| Lua function instead. | ||
- *'vim.g.github_transparent'* Use |setup| Lua function instead. | ||
- *'vim.g.github_hide_end_of_buffer'* Use |setup| Lua function instead. | ||
- *'vim.g.github_hide_inactive_statusline'* Use |setup| Lua function instead. | ||
- *'vim.g.github_msg_area_style'* Use |setup| Lua function instead. | ||
- *'vim.g.github_comment_style'* Use |setup| Lua function instead. | ||
- *'vim.g.github_function_style'* Use |setup| Lua function instead. | ||
- *'vim.g.github_keyword_style'* Use |setup| Lua function instead. | ||
- *'vim.g.github_variable_style'* Use |setup| Lua function instead. | ||
- *'vim.g.github_dev'* Use |setup| Lua function instead. | ||
|
||
FUNCTIONS | ||
- *'config.apply_configuration()'* Deprecated. | ||
|
||
|
||
vim:noet:tw=78:ts=8:ft=help:norl: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,24 @@ | ||
local vim_config = require('github-theme.config.vim_config') | ||
local default_config = require('github-theme.config.default') | ||
local M = {} | ||
local types = require('github-theme.types') | ||
|
||
---@class gt.Config | ||
---@field schema gt.ConfigSchema | ||
local config = {} | ||
|
||
---Accessing global config using vim.g.github_* will help in autocompletion. | ||
|
||
config.schema = { | ||
colors = vim_config.get(vim.g.github_colors, default_config.colors), | ||
comment_style = vim_config.get(vim.g.github_comment_style, default_config.comment_style), | ||
dark_float = vim_config.get(vim.g.github_dark_float, default_config.dark_float), | ||
dark_sidebar = vim_config.get(vim.g.github_dark_sidebar, default_config.dark_sidebar), | ||
dev = vim_config.get(vim.g.github_dev, default_config.dev), | ||
function_style = vim_config.get(vim.g.github_function_style, default_config.function_style), | ||
hide_end_of_buffer = vim_config.get(vim.g.github_hide_end_of_buffer, default_config.hide_end_of_buffer), | ||
hide_inactive_statusline = vim_config.get(vim.g.github_hide_inactive_statusline, default_config.hide_inactive_statusline), | ||
keyword_style = vim_config.get(vim.g.github_keyword_style, default_config.keyword_style), | ||
msg_area_style = vim_config.get(vim.g.github_msg_area_style, default_config.msg_area_style), | ||
overrides = vim_config.get(vim.g.github_overrides, default_config.overrides), | ||
sidebars = vim_config.get(vim.g.github_sidebars, default_config.sidebars), | ||
theme_style = vim_config.get(vim.g.github_theme_style, default_config.theme_style), | ||
transparent = vim_config.get(vim.g.github_transparent, default_config.transparent), | ||
variable_style = vim_config.get(vim.g.github_variable_style, default_config.variable_style), | ||
M.default = { | ||
colors = {}, | ||
comment_style = types.gt.HighlightStyle.Italic, | ||
dark_float = false, | ||
dark_sidebar = true, | ||
dev = false, | ||
function_style = types.gt.HighlightStyle.None, | ||
hide_end_of_buffer = true, | ||
hide_inactive_statusline = true, | ||
keyword_style = types.gt.HighlightStyle.Italic, | ||
msg_area_style = types.gt.HighlightStyle.None, | ||
overrides = function() | ||
return {} | ||
end, | ||
sidebars = {}, | ||
theme_style = types.gt.ThemeStyle.Dark, | ||
transparent = false, | ||
variable_style = types.gt.HighlightStyle.None, | ||
} | ||
|
||
---Override user's configuration | ||
---@param user_config gt.ConfigSchema | ||
config.apply_configuration = function(user_config) | ||
for key, value in pairs(user_config) do | ||
if value ~= nil then | ||
if config.schema[key] ~= nil then | ||
-- override value | ||
config.schema[key] = value | ||
vim_config.set(key, value) | ||
else | ||
error('config ' .. key .. ' does not exist') -- luacheck: ignore | ||
end | ||
end | ||
end | ||
end | ||
|
||
return config | ||
return M |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.