itchyny/lightline.vim

Buffers are not closed

dr-costas opened this issue · 9 comments

Hi,

I'm using Lightline with my Vim set-up and recently (like last month? ) it seems that the integration of Lightline has been broken.

Specifically, I'm sing Lightline along with Vimspector and the buffers created by Vimspector are no longer destroyed in Lightline. That is, when I invoke Vimspector for debugging, VImspector creates some buffers that are shown in Lightline. When I exit Vimspector by terminating it, previously the buffers created by Vimspector in Lightline were wiped out in Lightline as well. The last couple of months, the buffers are not wiped out.

I tried using only Vispector and the buffers are indeed destroyed. That is, I'm invoking and exiting Vimspector and then the command :buffers shows no open buffer. When I use Lightline with Vimspector, after I exit Vimspector the command :buffers shows open buffers.

Any solutions?

I have no clue what you're facing, how critical it is. Please provide some screenshots and minimum vimrc configuration and steps so that I can reproduce the issue.

Thank you for the reply and I'm sorry for the confusing message.

To begin with, Vimspector is a debugger package for Vim. You can check it here: https://github.com/puremourning/vimspector

I'm using Vimspector and Lightline for some time now (over 2 years) and the problem that I'm facing is fairly new. Here is the problem:

I'm writing Python and I'm debugging it with Vimspector. See screen shot below for the testing file:

Screenshot 2023-06-16 at 11 06 24

Then, I'm starting Vimspector to debug, see screenshot below:

Screenshot 2023-06-16 at 11 07 07

As you can see at the last screenshot, there are three buffers open:

  1. The file that I debug, main.py
  2. A log buffer that Vimspector uses for logging (buffer 12)
  3. A terminal buffer that Vimspector uses for Python output (buffer 14)

The correct behaviour would be to exit Vimspector and the 12 and 14 buffers be wiped out. I have tested this with Vimspector only and with Vimspector and other plugins, without Lightline.

When I load Lightline, without any configuration from my side, then buffer 14 stays open as you can see in the screenshot below

Screenshot 2023-06-16 at 11 07 33

Unfortunately, I don't know how to provide a minimal example, as it involves two plugins. If you can help me, I can do that as well.

You can check the issue that I opened at Vimspector here:

puremourning/vimspector#776

Where I tested Vimspector and it shows that the above behaviour doesn't come from it.

Then, I'm starting Vimspector to debug, see screenshot below:

Would you tell me how to start debugging? I tried VimspectorEval python but just got Vimspector not connected, start a debug session first.

Use <Plug>VimspectorRestart to start debugging.

You can also use the testing scripts that Vimspector has, at /path/to/vimspector/support/minimal_vimrc. The staring of he debugging is done by using key <F4>, which (when using mapping = HUMAN) evaluates to <Plug>VimspectorRestart.

I tried installing with git clone https://github.com/puremourning/vimspector ~/.vim/pack/vimspector/opt/vimspector, add let g:vimspector_enable_mappings = 'HUMAN' to .vimrc and packadd! vimspector. I Installed an adapter with :VimspectorInstall debugpy. Prints Vimspector gadget installation complete! so opened a Python file with 3 lines of print(0) and pressed <F4> but just prints Unable to find any debug configurations. You need to tell vimspector how to launch your application.. What's next?

Thank you for your effort. Please find at this link a test project for Vim that is using Vimspector to debug. You just need to set-up a breakpoint (using <F9>) and then press <F4> to start debug

https://drive.google.com/file/d/1B0k3FctJbpICcwKVAcdO8f-2JbL1l0NT/view?usp=share_link

Tell me when you have the files so I can delete them.

Sorry but I couldn't find any clue yet. This issue report is pretty hard to reproduce and I can't find time to tackle further. Needs to minimize the reproduction steps without any other plugins than lightline.