Skip to content

Commit

Permalink
fix BufWinLeave for the main Vdebug windows
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
BlackIkeEagle committed Sep 9, 2020
1 parent 8ea3620 commit 9096fc1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python3/vdebug/ui/vimui.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@ def create(self, open_cmd):
self.creation_count += 1

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

Expand Down

0 comments on commit 9096fc1

Please sign in to comment.