fix(extension): fix some extension showing a section in whole line

For now use a dummy component to lualine_x on extensions that only define
lualine_a. This will let the renderer know right sections do exist.

closes #73
This commit is contained in:
shadmansaleh 2021-10-01 19:54:57 +06:00
parent 05314de43a
commit 846e5bdabf
3 changed files with 24 additions and 0 deletions

View File

@ -4,10 +4,18 @@ local function fzf_statusline()
return 'FZF' return 'FZF'
end end
local empty = {
function()
return ' '
end,
padding = 0,
}
local M = {} local M = {}
M.sections = { M.sections = {
lualine_a = { fzf_statusline }, lualine_a = { fzf_statusline },
lualine_x = { empty },
} }
M.filetypes = { 'fzf' } M.filetypes = { 'fzf' }

View File

@ -4,10 +4,18 @@ local function get_short_cwd()
return vim.fn.fnamemodify(vim.fn.getcwd(), ':~') return vim.fn.fnamemodify(vim.fn.getcwd(), ':~')
end end
local empty = {
function()
return ' '
end,
padding = 0,
}
local M = {} local M = {}
M.sections = { M.sections = {
lualine_a = { get_short_cwd }, lualine_a = { get_short_cwd },
lualine_x = { empty },
} }
M.filetypes = { 'nerdtree' } M.filetypes = { 'nerdtree' }

View File

@ -5,10 +5,18 @@ local function toggleterm_statusline()
return 'ToggleTerm #' .. vim.b.toggle_number return 'ToggleTerm #' .. vim.b.toggle_number
end end
local empty = {
function()
return ' '
end,
padding = 0,
}
local M = {} local M = {}
M.sections = { M.sections = {
lualine_a = { toggleterm_statusline }, lualine_a = { toggleterm_statusline },
lualine_x = { empty },
} }
M.filetypes = { 'toggleterm' } M.filetypes = { 'toggleterm' }