nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.93k stars 462 forks source link

`<CTRL_C>` breaks lualine #122

Closed 0ihsan closed 3 years ago

0ihsan commented 3 years ago

This is not happening every time I hit CTRL_C but sometimes.

CTRL-C breaks lualine

The error is

E5108: Error executing lua Keyboard interrupt
hoob3rt commented 3 years ago

Mmm, this looks like it's not an issue with lualine but with the lua nvim api. Can you confirm that CTRL_C also breaks other lua plugins?

0ihsan commented 3 years ago

I haven't tried and don't know how to. Maybe secretly but this one was obvious. Should I create the issue on https://github.com/neovim/neovim?

shadmansaleh commented 3 years ago

Can you provide more information of how to reproduce it ? It's proving to be really hard to reproduce . If we can find a easier way to reproduce it we can test it on other plugins ..

0ihsan commented 3 years ago

I don't know how to reproduce exactly but I collected some key points I realised this issue occurs.

1. ✅ No Problem

  1. Open nvim
  2. Press i or a
  3. Press CTRL-C
  4. Go to step 2

2. ✅ No Problem

  1. Open nvim
  2. Press i or a
  3. Type "hello"
  4. Press CTRL-C
  5. Go to step 2

3. ❌ Issue Occurs

  1. Open an empty python file nvim x.py
  2. Press i or a
  3. Press CTRL-C
  4. Press i or a one more time (sometimes more than twice)
  5. Press CTRL-C
  6. See the status line disappeared and error message printed.

So, I suspect that this is something to do with filetypes or Python specific. I tried other filetypes and saw they are affected too. Here the filetypes I tried

I also tested how many times should I go to insert mode and normal mode again to reproduce this issue. (I counted [i+CTRL-C] as 1)

So, I couldn't see I pattern here.


See Also

shadmansaleh commented 3 years ago

Thanks for the info. In your config I can see you are using separate function for relative paths . But
lualines filename component provides relative path too . You can do

lauline_c = {{'filename', full_path = true}},

You can checkout Component options for details :)

0ihsan commented 3 years ago

Thank you, but I also have the filename blocking mechanism for terminal buffers in that function.

hoob3rt commented 3 years ago

I stand by my point that it's not a lualine issue nor is it your configuration issue. All we are doing in our filetype components is calling vim.fn.expand functions. My guess is that it's a neovim/vim bug. Go ahead and submit an issue but I think you need to find a real cause of this crash as I suspect they would blame us if you refer a plugin with your ticket.

shadmansaleh commented 3 years ago

I suspect they would blame us if you refer a plugin with your ticket.

Not true . The neovim guys are pretry cool . I had mentioned this issue on neovim gitter . This issue needs better way of reproduceing if the cause is ever to be found . After aton of attempts I was only able to make it happen twice . Also it just happens randomly . Trying aton of times the same thing and wating for a bug to affect is npt realistic to do . Also I was actualy gona ask @ihsanturk are you using current master of neovim? I'm using current master and this issue almost naver happens . If you're using an old version can you try current master maybe this has been partialy solved already :)

0ihsan commented 3 years ago

I am using v0.5.0-dev. I will try master. Thanks.

0ihsan commented 3 years ago

I solved by mapping <C-C> -> <C-[> as a workaround.

icholy commented 2 years ago

I'm using nightly builds and this happens about once every hour for me. I cannot find a way to reliably reproduce.