Skip to content

Commit 9096fc1

Browse files
committed
fix BufWinLeave for the main Vdebug windows
Avoids trace: ``` Error detected while processing BufWinLeave Autocommands for "DebuggerBreakpoints": Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/user/.vim/pack/bundle/opt/vdebug/python3/vdebug/debugger_interface.py", line 114, in mark_window_as_closed self.session_handler.ui().mark_window_as_closed(window) File "/home/user/.vim/pack/bundle/opt/vdebug/python3/vdebug/ui/vimui.py", line 173, in mark_window_as_closed self.windows.window(name).mark_as_closed() File "/home/user/.vim/pack/bundle/opt/vdebug/python3/vdebug/ui/vimui.py", line 533, in mark_as_closed self.destroy() File "/home/user/.vim/pack/bundle/opt/vdebug/python3/vdebug/ui/vimui.py", line 598, in destroy vim.command('bwipeout %s' % self.name) vim.error: Vim(bwipeout):E937: Attempt to delete a buffer that is in use: DebuggerBreakpoints ``` fixes: #451 Signed-off-by: BlackEagle <ike.devolder@gmail.com>
1 parent 8ea3620 commit 9096fc1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎python3/vdebug/ui/vimui.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ def create(self, open_cmd):
586586
self.creation_count += 1
587587

588588
if self.creation_count == 1:
589-
cmd = 'autocmd Vdebug BufWinLeave %s' % self.name
589+
cmd = 'autocmd Vdebug BufWinLeave %s silent! bdelete %s' \
590+
% (self.name, self.name)
590591
cmd += ' python3 debugger.mark_window_as_closed("%s")' % self.name
591592
vim.command(cmd)
592593

0 commit comments

Comments
 (0)