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

ViMode Update ModeChanged makes heirline crash on smaller terminal sizes #175

Open
cronyakatsuki opened this issue Nov 21, 2023 · 2 comments

Comments

@cronyakatsuki
Copy link

cronyakatsuki commented Nov 21, 2023

Recently I started using heirline and have seen that it sometimes crashes when my terminal windows is small in size.

Here is the crash ouput:

eirline.nvim/lua/heirline/statusline.lua:381: bad argument #1 to 'prov
ider' (string expected, got nil)
stack traceback:
        [C]: in function 'provider'
        ...hare/nvim/lazy/heirline.nvim/lua/heirline/statusline.lua:38
1: in function '_eval'
        ...hare/nvim/lazy/heirline.nvim/lua/heirline/statusline.lua:39
8: in function '_eval'
        ...hare/nvim/lazy/heirline.nvim/lua/heirline/statusline.lua:39
8: in function '_eval'
        ...hare/nvim/lazy/heirline.nvim/lua/heirline/statusline.lua:47
3: in function 'eval'
        ...ocal/share/nvim/lazy/heirline.nvim/lua/heirline/init.lua:10
9: in function <...ocal/share/nvim/lazy/heirline.nvim/lua/heirline/ini
t.lua:104>
        [C]: in function 'nvim_exec2'
        vim/_editor.lua: in function 'cmd'
        /home/crony/.config/nvim/lua/crony/plugins/heirline.lua:109: i
n function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
stack traceback:
        [C]: in function 'nvim_exec2'
        vim/_editor.lua: in function 'cmd'
        /home/crony/.config/nvim/lua/crony/plugins/heirline.lua:109: i
n function ''

Here is a link to my current heirline config

Edit: The config is almost 100% just copy paste job from the wiki.

@cronyakatsuki cronyakatsuki changed the title Heirline sometimes crashes while quiting. ViMode Update ModeChanged makes heirline crash on smaller terminal sizes Dec 10, 2023
@cronyakatsuki
Copy link
Author

After some playing around with the config, I have seen that by commenting out this block of code for ViMode component copied from the wiki fixed this issue.

      update = {
        "ModeChanged",
        pattern = "*:*",
        callback = vim.schedule_wrap(function()
          vim.cmd.redrawstatus()
        end),
      },

By commenting it out the ViMode component still works normally and doesn't throw the error when quiting neovim.

@rebelot
Copy link
Owner

rebelot commented Jul 4, 2024

see fix in #203

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