vimpostor / vim-tpipeline

Embed your vim statusline in tmux
GNU General Public License v3.0
369 stars 11 forks source link

duplicate statusline on splits using lualine #67

Closed encleine closed 2 months ago

encleine commented 2 months ago

Describe the bug

when making a vertical split in neovim a duplicate statusline is made on top of the split buffer

duplicate

To reproduce

empty config with just lualine and vim-tpipeline

using lazy

return {

  {
    -- Set lualine as statusline
    'nvim-lualine/lualine.nvim',
    dependencies = {
      { 'tanvirtin/monokai.nvim', lazy = true },
    },
  },

  'vimpostor/vim-tpipeline',
}

with the default changes from the README

set -g focus-events on
set -g status-style bg=default
set -g status-left-length 90
set -g status-right-length 90
set -g status-justify absolute-

Expected behavior

the statusline only appearing on the bottom where the tmux bar is

Terminal emulator

kitty terminal

Debug output

{'native_str': ' NORMAL lua/custom/plugins/init.lua                                                           LUA        12 ', 'brand': 'neovim', 'right': ['#[fg=NvimDarkGrey3,bg=NvimLightGrey3]#[fg=#03a9f4,bg=default] #[fg=#0
00000,bg=#03a9f4]LUA#[fg=#03a9f4,bg=default] #[fg=#9e9e9e,bg=default]#[fg=#ffffff,bg=#9e9e9e]       12 #[fg=#9e9e9e,bg=default]'], 'job_state': 'run as PID 38926', 'bad_colors': 333, 'job_errors': [], 'tpipeline_size': 233, 'versio
n_info': '{   api_compatible = 0,   api_level = 12,   api_prerelease = false,   build = vim.NIL,   major = 0,   minor = 10,   patch = 1,   <metatable> = {     __eq = <function 1>,     __index = <function 2>,     __le = <function 3>,
    __lt = <function 4>,     __newindex = <function 5>,     __tostring = <function 6>   } }', 'tmux': 'tmux 3.4', 'left': ['#[fg=NvimDarkGrey3,bg=NvimLightGrey3]#[fg=#ffffff,bg=#795548] #[fg=#ffffff,bg=#795548]COMMAND#[fg=#795548,bg=
default] #[fg=#607d8b,bg=default]#[fg=#ffffff,bg=#607d8b]lua/custom/plugins/init.lua#[fg=#607d8b,bg=default]#[fg=nvimlightgrey2,bg=nvimdarkgrey2]'], 'plugin_version': '1.0', 'native_highlights': [{'group': 'TpipelineLightGreen', '
start': 0}, {'group': 'TpipelineLightGreen', 'start': 1}, {'group': 'TpipelineLightGreenInv', 'start': 7}, {'group': 'TpipelineBlueGreyInv', 'start': 11}, {'group': 'TpipelineBlueGrey', 'start': 14}, {'group': 'TpipelineBlueGreyInv',
 'start': 41}, {'group': 'Ignore', 'start': 44}, {'group': 'TpipelineLightBlueInv', 'start': 102}, {'group': 'TpipelineLightBlue', 'start': 106}, {'group': 'TpipelineLightBlueInv', 'start': 109}, {'group': 'TpipelineGreyInv', 'start'
: 113}, {'group': 'TpipelineGrey', 'start': 116}, {'group': 'TpipelineGreyInv', 'start': 126}], 'os': 'Linux', 'stl': '%!tpipeline#stl#line()'}
vimpostor commented 2 months ago

Make sure to fix misbehaving plugin managers like lazy.nvim, by adding the VeryLazy setup option:

{ 'vimpostor/vim-tpipeline', event = 'VeryLazy'}

Otherwise lazy.nvim completely wrecks havoc in the startup sequence:

lazy.nvim does NOT use Neovim packages and even disables plugin loading completely (vim.go.loadplugins = false).

And this is not even for any good reason, this snakeoil lazy-loading "optimization" from lazy.nvim is just for fake benchmark points, i.e. the numbers will disappear from --startuptime, but will still take and block for exactly as long at the end of startup. Instead this plugin and any sane plugin is already using the autoload mechanism to load functionality on demand, so there isn't even a need for these bullshit tricks (at least not for normal Vim plugins using autoload).

For more info see: https://github.com/vimpostor/vim-tpipeline/pull/66#issuecomment-2285862887

The reason that in this case the startup sequence matters, is because you are using another plugin that misbehaves. lualine for some strange reason decided to abandon idiomatic vim statusline handling and implemented their own weird timer based statusline handling, which among others resets the local statusline option for every single window during every single update. For more info read:

Due to this there are some workarounds necessary for lualine, that rely on the normal startup sequence.

As for your problem with the statusline appearing in split windows, take a look at :h g:tpipeline_clearstl, see: https://github.com/vimpostor/vim-tpipeline/issues/19

encleine commented 2 months ago

sorry for the duplicate issue the workarounds seemed to work minus the right part of the statusline disappearing which I guess is another lualine problem

thanks for the detailed response as well

vimpostor commented 2 months ago

No, if you don't see the right part, that shouldn't conflict with anything in lualine. Could you repost the debug output and the config to reproduce that?

encleine commented 2 months ago

it's odd because after restarting tmux a couple of times it fixed itself and I can't seem to reproduce it maybe an error on my side

vimpostor commented 2 months ago

No worries, I will close the issue then.