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

[bug] [no_name] buffer created and kept after GdbDebugStop #48

Closed
Narice opened this issue Jan 20, 2019 · 9 comments
Closed

[bug] [no_name] buffer created and kept after GdbDebugStop #48

Narice opened this issue Jan 20, 2019 · 9 comments
Assignees
Labels

Comments

@Narice
Copy link
Contributor

Narice commented Jan 20, 2019

Hi,
a "ghost" buffer is created or kept after stopping gdb with GdbDebugStop or typing directly in the command line "q".

I hope it's easily fixable

@sakhnik
Copy link
Owner

sakhnik commented Jan 20, 2019

I'm not sure I understand the issue. One [noname] buffer seems to be present upon nvim launch even without the plugin. Whatever I tried, I couldn't notice any unwanted buffers. Could you please describe the specific steps to reproduce the issue?
asciicast

@Narice
Copy link
Contributor Author

Narice commented Jan 20, 2019

I'll try to figure out what's causing it, it might be related to a .vimrc option
could it be related to "set hidden"?

@Narice
Copy link
Contributor Author

Narice commented Jan 20, 2019

for the steps, I'm exactly doing what you did.
And it's a different one from the startup one.
It adds a new buffer each time I'm leaving gdb.

@sakhnik
Copy link
Owner

sakhnik commented Jan 21, 2019

Well, if I'm using test/init.vim, no "ghosts". But as soon as I add set hidden, I experience the issue.
I'm not sure it'd be easy to tackle.

@Narice
Copy link
Contributor Author

Narice commented Jan 21, 2019

Maybe just disable hidden while in the process of quitting gdb and then re-enabling it
I'll try it later today

Narice added a commit to Narice/nvim-gdb that referenced this issue Jan 21, 2019
Changed the function GdbKill() for compatibility reasons with "set hidden" .vimrc option.
issue sakhnik#48 can be closed
@Frederick888
Copy link

Sorry for bumping an old issue but it seems this problem is still reproducible in my case. I'm running neovim v0.4.3 with the latest nvim-gdb and indeed I've got set hidden in vimrc. Just thinking out loud here but I wonder whether it's possible to just bwipe the buffers used by nvim-gdb during cleanup?

@sakhnik
Copy link
Owner

sakhnik commented May 13, 2020

Yes, probably. The plugin could keep track of the buffers specifically opened for the debugger. But the fix will require careful consideration because leaving "ghost" buffers around is a tiny nuisance in comparison to undesirable obliterations. What if a user edits the source code when debugging?

@Frederick888
Copy link

@sakhnik Then, again please bear with me just making assumptions here, is it possible to use named buffers for nvim-gdb? They don't need to be actually saved somewhere but only used for bufname matching as somewhat a guard during cleanup, e.g. /tmp/nvim-gdb.session-[0|1|2|...].[src|dbg].

@sakhnik
Copy link
Owner

sakhnik commented May 14, 2020

I guess this wouldn't be strictly necessary because the plugin could just remember the buffers. Then we could probably distinguish the modified ones from the untouched ones, skip through the unsaved ones etc. I'll have to experiment around.

@sakhnik sakhnik reopened this May 14, 2020
@sakhnik sakhnik added the bug label May 15, 2020
@sakhnik sakhnik self-assigned this May 15, 2020
sakhnik added a commit that referenced this issue May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants