fix: extensions not working without deepcopy (#223)

This commit is contained in:
Hubert Pelczarski 2021-05-10 18:27:39 +02:00 committed by GitHub
parent 82826ef661
commit 11280b44f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 8 deletions

View File

@ -4,9 +4,9 @@ local nerdtree = require('lualine.extensions.nerdtree')
local M = {} local M = {}
M.sections = nerdtree.sections M.sections = vim.deepcopy(nerdtree.sections)
M.inactive_sections = nerdtree.inactive_sections M.inactive_sections = vim.deepcopy(nerdtree.inactive_sections)
M.filetypes = {'CHADTree'} M.filetypes = {'CHADTree'}

View File

@ -2,9 +2,14 @@
-- MIT license, see LICENSE for more details. -- MIT license, see LICENSE for more details.
local M = {} local M = {}
M.sections = {lualine_a = {'FugitiveHead'}, lualine_z = {'location'}} local function fugitive_branch()
local icon = '' -- e0a0
return icon .. ' ' .. vim.fn.FugitiveHead()
end
M.inactive_sections = M.sections M.sections = {lualine_a = {fugitive_branch}, lualine_z = {'location'}}
M.inactive_sections = vim.deepcopy(M.sections)
M.filetypes = {'fugitive'} M.filetypes = {'fugitive'}

View File

@ -6,7 +6,7 @@ local M = {}
M.sections = {lualine_a = {fzf_statusline}} M.sections = {lualine_a = {fzf_statusline}}
M.inactive_sections = M.sections M.inactive_sections = vim.deepcopy(M.sections)
M.filetypes = {'fzf'} M.filetypes = {'fzf'}

View File

@ -6,7 +6,7 @@ local M = {}
M.sections = {lualine_a = {get_short_cwd}} M.sections = {lualine_a = {get_short_cwd}}
M.inactive_sections = M.sections M.inactive_sections = vim.deepcopy(M.sections)
M.filetypes = {'nerdtree'} M.filetypes = {'nerdtree'}

View File

@ -4,9 +4,9 @@ local nerdtree = require('lualine.extensions.nerdtree')
local M = {} local M = {}
M.sections = nerdtree.sections M.sections = vim.deepcopy(nerdtree.inactive_sections)
M.inactive_sections = nerdtree.inactive_sections M.inactive_sections = vim.deepcopy(nerdtree.inactive_sections)
M.filetypes = {'NvimTree'} M.filetypes = {'NvimTree'}