ref(colors): add NONE constant

The appearance of a lone `{}` was perhaps confusing to some. Behind the
scenes, whenever an attribute is missing from a table, it will be
defaulted to 'None'. Transiently, in using `{}` we are able to shortcut
directly to these defaults.

However, it does not read well. This commit introduces a constant that
makes it clear what is happening.
This commit is contained in:
Iron-E 2020-12-17 13:44:25 -05:00
parent 703f512407
commit 3bced25e47
No known key found for this signature in database
GPG Key ID: 19B71B7B7B021D22
1 changed files with 6 additions and 4 deletions

View File

@ -232,6 +232,7 @@ local purple_light = {'#af60af', 63, 'magenta'}
--[[ DO NOT EDIT `BG` NOR `FG`. ]] --[[ DO NOT EDIT `BG` NOR `FG`. ]]
local BG = 'bg' local BG = 'bg'
local FG = 'fg' local FG = 'fg'
local NONE = {}
--[[ These are the ones you should edit. ]] --[[ These are the ones you should edit. ]]
-- This is the only highlight that must be defined separately. -- This is the only highlight that must be defined separately.
@ -338,7 +339,7 @@ local highlight_groups = {
--[[ 4.2.6. Diffs]] --[[ 4.2.6. Diffs]]
DiffAdd = {fg=black, bg=green_dark}, DiffAdd = {fg=black, bg=green_dark},
DiffChange = {}, DiffChange = NONE,
DiffDelete = function(self) return {fg=self.DiffAdd.fg, bg=red} end, DiffDelete = function(self) return {fg=self.DiffAdd.fg, bg=red} end,
DiffText = function(self) return {fg=self.DiffAdd.fg, bg=yellow} end, DiffText = function(self) return {fg=self.DiffAdd.fg, bg=yellow} end,
@ -355,7 +356,7 @@ local highlight_groups = {
--[[ 4.2.9. Conditional Column Highlighting]] --[[ 4.2.9. Conditional Column Highlighting]]
ColorColumn = {style='inverse'}, ColorColumn = {style='inverse'},
SignColumn = {}, SignColumn = NONE,
--[[ 4.2.10. Messages]] --[[ 4.2.10. Messages]]
ErrorMsg = {fg=red, style='bold'}, ErrorMsg = {fg=red, style='bold'},
@ -463,7 +464,7 @@ local highlight_groups = {
goFormatSpecifier = 'Character', goFormatSpecifier = 'Character',
goFunction = 'Function', goFunction = 'Function',
goFunctionCall = 'goFunction', goFunctionCall = 'goFunction',
goFunctionReturn = {}, goFunctionReturn = NONE,
goMethodCall = 'goFunctionCall', goMethodCall = 'goFunctionCall',
goParamType = 'goReceiverType', goParamType = 'goReceiverType',
goPointerOperator = 'SpecialChar', goPointerOperator = 'SpecialChar',
@ -549,6 +550,7 @@ local highlight_groups = {
mkdCodeEnd = 'mkdCodeStart', mkdCodeEnd = 'mkdCodeStart',
mkdHeading = 'Delimiter', mkdHeading = 'Delimiter',
mkdItalic = 'mkdBold', mkdItalic = 'mkdBold',
mkdLineBreak = NONE,
mkdListItem = 'Special', mkdListItem = 'Special',
mkdRule = 'Underlined', mkdRule = 'Underlined',
@ -661,7 +663,7 @@ local highlight_groups = {
crontabMnth = 'Structure', crontabMnth = 'Structure',
--[[ 4.3.32. PlantUML ]] --[[ 4.3.32. PlantUML ]]
plantumlColonLine = {}, plantumlColonLine = NONE,
--[[ 4.3.33. YAML ]] --[[ 4.3.33. YAML ]]
yamlKey = 'Label', yamlKey = 'Label',