numToStr / FTerm.nvim

:fire: No-nonsense floating terminal plugin for neovim :fire:
MIT License
743 stars 23 forks source link

lualine-rendered statusline reverts to built-in statusline settings when FTerm is invoked in a buffer #36

Closed smacz42 closed 3 years ago

smacz42 commented 3 years ago

When FTerm is invoked in a buffer (in this case, to use gitui) the plugin lualine reverts to the built-in statusline. However, after switching buffers (:bn or bp), the statusline rendered by lualine returns. I do not see this behavior with other plugins that use floating windows such as rnvimr or fzf.vim.

The desired behavior is that the statusline does not revert to the built-in statusline after invoking FTerm.

I'm not sure how to go about looking into this further, but here are some relevant configs:

" A blazing fast and easy to configure neovim statusline written in pure lua.                                                                                                                                                       Plug 'hoob3rt/lualine.nvim' 

require('lualine').setup {
    options = {theme = 'everforest'}
}
local term = require("FTerm.terminal")

local gitui = term:new():setup({
    cmd = "gitui",
    dimensions = {
        height = 0.9,
        width = 0.9
    }
})

 -- Use this to toggle gitui in a floating terminal
function _G.__fterm_gitui()
    gitui:toggle()
end

-- Keybinding
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }

map('', '<leader>t', '<CMD>lua _G.__fterm_gitui()<CR>', opts)
map('', '<leader>T', '<C-\\><C-n><CMD>lua _G.__fterm_gitui()<CR>', opts)

Please let me know if there is any other relevant info that I can post.

numToStr commented 3 years ago

Interesting, as I am also using lualine but I never faced the issue that you are describing. Do you mind sharing a screen capture? I need to see what's the issue.

Also, if you are using lualine make sure to use https://github.com/shadmansaleh/lualine.nvim which is an up-to-date fork. Maybe It could fix your issue.

smacz42 commented 3 years ago

After updated to shadmansaleh's fork, the issue has resolved itself. Thanks for pointing me in the right direction!

numToStr commented 3 years ago

I gonna close this issue as your issue seems to be fixed :)