sakhnik / nvim-gdb

Neovim thin wrapper for GDB, LLDB, PDB/PDB++ and BashDB
723 stars 39 forks source link

Make the terminal window sticky #172

Closed sakhnik closed 2 years ago

sakhnik commented 2 years ago

Ensure the terminal window is always shown unless sticky_gdb_buf is set to false in the configuration. This addresses #171

sakhnik commented 2 years ago

@davxy, could you please review the change?

davxy commented 2 years ago

From https://github.com/sakhnik/nvim-gdb/commit/fabac46ce9db6ce7c136f25b9875659d638cbe77 my terminal freeze on lldb exit.

Looks it has something to do with the check_sticky function

sakhnik commented 2 years ago

That's fine, the freeze is fixed in the subsequent commits. But I've just realized that this change requires nvim-0.7 strictly because of the new API. Does the HEAD revision in the branch sticky work for you?

davxy commented 2 years ago

That's fine, the freeze is fixed in the subsequent commits. But I've just realized that this change requires nvim-0.7 strictly because of the new API. Does the HEAD revision in the branch sticky work for you?

It freezes from that commit. It also freezes for all the following ones up to the HEAD (I'm using nvim 0.7)

sakhnik commented 2 years ago

That's strange especially when the tests pass both on GitHub and locally. I'll have to experiment around trying to reproduce the issue. I believe I suspected a potential race in one piece of the code.

sakhnik commented 2 years ago

@davxy, fixed that one. Could you please take another look? Are there any suggestions of better naming of the feature and its config?

davxy commented 2 years ago

If, while I'm in the debugger window, I send a bn command it opens a new window instead of reusing the current one. Here is a video:

asciicast

davxy commented 2 years ago

Are there any suggestions of better naming of the feature and its config?

I would rename:

But if I have to be honest I would rename the whole project from nvim-gdb to something more inclusive like nvim-dbg (I assume that the current name is due to the first implementation covering only gdb?)

You will not loose any info and the existing url is automatically redirected to the new one (https://docs.github.com/en/repositories/creating-and-managing-repositories/renaming-a-repository)

sakhnik commented 2 years ago

If, while I'm in the debugger window, I send a bn command it opens a new window instead of reusing the current one.

That makes sense. As soon as the debugger buffer is about to be hidden, a new window is created, and the debugger terminal gets resurrected in it. This may be confusing when :bn is requested. But there are multiple ways to (try to) get rid of the terminal window. For example, :only. And I couldn't think of a generic way to keep the terminal buffer visible, but to create a new window.

But if I have to be honest I would rename the whole project from nvim-gdb to something more inclusive like nvim-dbg (I assume that the current name is due to the first implementation covering only gdb?)

It sounds rational, I'll have to consider it.

sakhnik commented 2 years ago

This branch goes into devel, which is compatible with neovim-0.7. I'm going to port the fix to neovim-0.6 for the branch master.