chore: autogen (vimdocs+formating)

This commit is contained in:
shadmansaleh 2022-03-05 13:41:08 +00:00 committed by github-actions[bot]
parent 747ef49b98
commit a1304ea8b6
3 changed files with 15 additions and 11 deletions

View File

@ -19,8 +19,10 @@ end
--- of the tab. --- of the tab.
---@return string ---@return string
function Tab:label() function Tab:label()
local ok,custom_tabname = pcall(vim.api.nvim_tabpage_get_var, self.tabId, 'tabname') local ok, custom_tabname = pcall(vim.api.nvim_tabpage_get_var, self.tabId, 'tabname')
if not ok then custom_tabname = nil end if not ok then
custom_tabname = nil
end
if custom_tabname and custom_tabname ~= '' then if custom_tabname and custom_tabname ~= '' then
return modules.utils.stl_escape(custom_tabname) return modules.utils.stl_escape(custom_tabname)
end end

View File

@ -568,7 +568,9 @@ describe('Branch component', function()
local tmpdir local tmpdir
local file local file
local git = function(...) local git = function(...)
return vim.fn.system("git -c user.name='asdf' -c user.email='asdf@jlk.org' -C " .. tmpdir .. ' ' .. string.format(...)) return vim.fn.system(
"git -c user.name='asdf' -c user.email='asdf@jlk.org' -C " .. tmpdir .. ' ' .. string.format(...)
)
end end
local assert_comp_ins = helpers.assert_component_instence local assert_comp_ins = helpers.assert_component_instence
@ -610,10 +612,10 @@ describe('Branch component', function()
icons_enabled = false, icons_enabled = false,
padding = 0, padding = 0,
} }
git 'checkout -b test_branch2' git('checkout -b test_branch2')
git 'commit --allow-empty -m "test commit1"' git('commit --allow-empty -m "test commit1"')
git 'commit --allow-empty -m "test commit2"' git('commit --allow-empty -m "test commit2"')
git 'commit --allow-empty -m "test commit3"' git('commit --allow-empty -m "test commit3"')
git('checkout HEAD~1') git('checkout HEAD~1')
vim.cmd('e ' .. file) vim.cmd('e ' .. file)
local rev = git('rev-parse --short=6 HEAD'):sub(1, 6) local rev = git('rev-parse --short=6 HEAD'):sub(1, 6)

View File

@ -107,11 +107,11 @@ int build_stl_str_hl(
local function process_hlrec(hltab, stlbuf, eval_type) local function process_hlrec(hltab, stlbuf, eval_type)
local function default_hl() local function default_hl()
if eval_type == 'tabline' then if eval_type == 'tabline' then
return "TabLineFill" return 'TabLineFill'
elseif eval_type == 'inactive' then elseif eval_type == 'inactive' then
return "StatusLineNC" return 'StatusLineNC'
else else
return "StatusLine" return 'StatusLine'
end end
end end
local len = #ffi.string(stlbuf) local len = #ffi.string(stlbuf)
@ -169,7 +169,7 @@ local function eval_stl(stl_expr, width, eval_type)
if vim.fn.has('nvim-0.6') == 1 then if vim.fn.has('nvim-0.6') == 1 then
stl_eval_res = vim.api.nvim_eval_statusline( stl_eval_res = vim.api.nvim_eval_statusline(
stl_expr, stl_expr,
{ maxwidth = width, highlights = true, fillchar = ' ', use_tabline = (eval_type == 'tabline')} { maxwidth = width, highlights = true, fillchar = ' ', use_tabline = (eval_type == 'tabline') }
) )
else else
stl_eval_res = gen_stl(stl_expr, width, eval_type) stl_eval_res = gen_stl(stl_expr, width, eval_type)