style: Spell fix instence -> instance (#184)

This commit is contained in:
Tim Bedard 2021-04-19 22:02:21 -05:00 committed by GitHub
parent 2158095193
commit 96938c5db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 28 deletions

View File

@ -22,43 +22,43 @@ Diff.default_colors = {
-- Initializer -- Initializer
Diff.new = function(self, options, child) Diff.new = function(self, options, child)
local new_instence = self._parent:new(options, child or Diff) local new_instance = self._parent:new(options, child or Diff)
local default_symbols = {added = '+', modified = '~', removed = '-'} local default_symbols = {added = '+', modified = '~', removed = '-'}
new_instence.options.symbols = vim.tbl_extend('force', default_symbols, new_instance.options.symbols = vim.tbl_extend('force', default_symbols,
new_instence.options.symbols or new_instance.options.symbols or
{}) {})
if new_instence.options.colored == nil then if new_instance.options.colored == nil then
new_instence.options.colored = true new_instance.options.colored = true
end end
-- apply colors -- apply colors
if not new_instence.options.color_added then if not new_instance.options.color_added then
new_instence.options.color_added = utils.extract_highlight_colors('DiffAdd', new_instance.options.color_added = utils.extract_highlight_colors('DiffAdd',
'fg') or 'fg') or
Diff.default_colors.added Diff.default_colors.added
end end
if not new_instence.options.color_modified then if not new_instance.options.color_modified then
new_instence.options.color_modified = new_instance.options.color_modified =
utils.extract_highlight_colors('DiffChange', 'fg') or utils.extract_highlight_colors('DiffChange', 'fg') or
Diff.default_colors.modified Diff.default_colors.modified
end end
if not new_instence.options.color_removed then if not new_instance.options.color_removed then
new_instence.options.color_removed = new_instance.options.color_removed =
utils.extract_highlight_colors('DiffDelete', 'fg') or utils.extract_highlight_colors('DiffDelete', 'fg') or
Diff.default_colors.removed Diff.default_colors.removed
end end
-- create highlights and save highlight_name in highlights table -- create highlights and save highlight_name in highlights table
if new_instence.options.colored then if new_instance.options.colored then
new_instence.highlights = { new_instance.highlights = {
added = highlight.create_component_highlight_group( added = highlight.create_component_highlight_group(
{fg = new_instence.options.color_added}, 'diff_added', {fg = new_instance.options.color_added}, 'diff_added',
new_instence.options), new_instance.options),
modified = highlight.create_component_highlight_group( modified = highlight.create_component_highlight_group(
{fg = new_instence.options.color_modified}, 'diff_modified', {fg = new_instance.options.color_modified}, 'diff_modified',
new_instence.options), new_instance.options),
removed = highlight.create_component_highlight_group( removed = highlight.create_component_highlight_group(
{fg = new_instence.options.color_removed}, 'diff_removed', {fg = new_instance.options.color_removed}, 'diff_removed',
new_instence.options) new_instance.options)
} }
end end
@ -68,7 +68,7 @@ Diff.new = function(self, options, child)
autocmd lualine BufWritePost * lua require'lualine.components.diff'.update_git_diff() autocmd lualine BufWritePost * lua require'lualine.components.diff'.update_git_diff()
]], false) ]], false)
return new_instence return new_instance
end end
-- Function that runs everytime statusline is updated -- Function that runs everytime statusline is updated

View File

@ -3,20 +3,20 @@
local FileName = require('lualine.component'):new() local FileName = require('lualine.component'):new()
FileName.new = function(self, options, child) FileName.new = function(self, options, child)
local new_instence = self._parent:new(options, child or FileName) local new_instance = self._parent:new(options, child or FileName)
-- setting defaults -- setting defaults
if new_instence.options.file_status == nil then if new_instance.options.file_status == nil then
new_instence.options.file_status = true new_instance.options.file_status = true
end end
if new_instence.options.shorten == nil then if new_instance.options.shorten == nil then
new_instence.options.shorten = true new_instance.options.shorten = true
end end
if new_instence.options.full_path == nil then if new_instance.options.full_path == nil then
new_instence.options.full_path = false new_instance.options.full_path = false
end end
return new_instence return new_instance
end end
FileName.update_status = function(self) FileName.update_status = function(self)