chore: formated with stylua (#36)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2021-09-04 23:18:50 +06:00 committed by GitHub
parent 7185c61e9e
commit a26ffaa8ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 22 deletions

View File

@ -1,29 +1,29 @@
local lualine_require = require'lualine_require' local lualine_require = require 'lualine_require'
local modules = lualine_require.lazy_require{ local modules = lualine_require.lazy_require {
utils_notices = 'lualine.utils.notices' utils_notices = 'lualine.utils.notices',
} }
local sep = package.config:sub(1,1) local sep = package.config:sub(1, 1)
local wal_colors_path = table.concat({os.getenv("HOME"), ".cache", "wal", "colors.sh"}, sep) local wal_colors_path = table.concat({ os.getenv 'HOME', '.cache', 'wal', 'colors.sh' }, sep)
local wal_colors_file = io.open(wal_colors_path, "r") local wal_colors_file = io.open(wal_colors_path, 'r')
if wal_colors_file == nil then if wal_colors_file == nil then
modules.utils_notices.add_notice("lualine.nvim: " .. wal_colors_path .. " not found") modules.utils_notices.add_notice('lualine.nvim: ' .. wal_colors_path .. ' not found')
error("") error ''
end end
local ok, wal_colors_text = pcall(wal_colors_file.read, wal_colors_file, '*a') local ok, wal_colors_text = pcall(wal_colors_file.read, wal_colors_file, '*a')
wal_colors_file:close() wal_colors_file:close()
if not ok then if not ok then
modules.utils_notices.add_notice("lualine.nvim: " .. wal_colors_path .. " could not be read: " .. wal_colors_text) modules.utils_notices.add_notice('lualine.nvim: ' .. wal_colors_path .. ' could not be read: ' .. wal_colors_text)
error("") error ''
end end
local colors = {} local colors = {}
for line in vim.gsplit(wal_colors_text, '\n') do for line in vim.gsplit(wal_colors_text, '\n') do
if line:match('^[a-z0-9]+=\'#[a-f0-9]+\'') ~= nil then if line:match "^[a-z0-9]+='#[a-f0-9]+'" ~= nil then
local i = line:find('=') local i = line:find '='
local key = line:sub(0, i - 1) local key = line:sub(0, i - 1)
local value = line:sub(i + 2, #line - 1) local value = line:sub(i + 2, #line - 1)
colors[key] = value colors[key] = value
@ -32,16 +32,16 @@ end
return { return {
normal = { normal = {
a = {fg = colors.background, bg = colors.color4, gui = 'bold'}, a = { fg = colors.background, bg = colors.color4, gui = 'bold' },
b = {fg = colors.foreground, bg = colors.color8}, b = { fg = colors.foreground, bg = colors.color8 },
c = {fg = colors.foreground, bg = colors.background} c = { fg = colors.foreground, bg = colors.background },
}, },
insert = {a = {fg = colors.background, bg = colors.color2, gui = 'bold'}}, insert = { a = { fg = colors.background, bg = colors.color2, gui = 'bold' } },
visual = {a = {fg = colors.background, bg = colors.color3, gui = 'bold'}}, visual = { a = { fg = colors.background, bg = colors.color3, gui = 'bold' } },
replace = {a = {fg = colors.background, bg = colors.color1, gui = 'bold'}}, replace = { a = { fg = colors.background, bg = colors.color1, gui = 'bold' } },
inactive = { inactive = {
a = {fg = colors.foreground, bg = colors.background, gui = 'bold'}, a = { fg = colors.foreground, bg = colors.background, gui = 'bold' },
b = {fg = colors.foreground, bg = colors.background}, b = { fg = colors.foreground, bg = colors.background },
c = {fg = colors.foreground, bg = colors.background} c = { fg = colors.foreground, bg = colors.background },
} },
} }