Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate statusline on splits using lualine #67

Closed
encleine opened this issue Sep 30, 2024 · 5 comments
Closed

duplicate statusline on splits using lualine #67

encleine opened this issue Sep 30, 2024 · 5 comments

Comments

@encleine
Copy link

encleine commented Sep 30, 2024

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
Copy link
Owner

vimpostor commented Sep 30, 2024

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: #66 (comment)

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: #19

@encleine
Copy link
Author

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
Copy link
Owner

vimpostor commented Sep 30, 2024 via email

@encleine
Copy link
Author

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
Copy link
Owner

No worries, I will close the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants