From b550088818271b6ceb879bab300b64270cdc5b6e Mon Sep 17 00:00:00 2001 From: BlackEagle Date: Wed, 9 Sep 2020 20:57:48 +0200 Subject: [PATCH 1/3] vimui linting style fix Signed-off-by: BlackEagle --- python3/vdebug/ui/vimui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3/vdebug/ui/vimui.py b/python3/vdebug/ui/vimui.py index a8e078a..478c4fe 100644 --- a/python3/vdebug/ui/vimui.py +++ b/python3/vdebug/ui/vimui.py @@ -158,8 +158,8 @@ def __init__(self): 'DebuggerStatus': 'vertical leftabove new' }, 'window_size': { - 'DebuggerWatch': { 'height' : 15 }, - 'DebuggerStatus': { 'height' : 1 } + 'DebuggerWatch': {'height': 15}, + 'DebuggerStatus': {'height': 1} }, 'window_arrangement': [ 'DebuggerWatch', From 8ea3620d8024abe0bcb7a814e3c2d1fe23ee12de Mon Sep 17 00:00:00 2001 From: BlackEagle Date: Wed, 9 Sep 2020 20:58:16 +0200 Subject: [PATCH 2/3] no need to load the buffer, we already have it Signed-off-by: BlackEagle --- python3/vdebug/ui/vimui.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python3/vdebug/ui/vimui.py b/python3/vdebug/ui/vimui.py index 478c4fe..47de27e 100644 --- a/python3/vdebug/ui/vimui.py +++ b/python3/vdebug/ui/vimui.py @@ -597,7 +597,6 @@ def destroy(self, wipeout=True): if self._buffer is None: return self.is_open = False - self._buffer = HiddenBuffer(self._buffer.contents()) if wipeout and int(vim.eval('buffer_exists("%s")' % self.name)) == 1: vim.command('bwipeout %s' % self.name) self.on_destroy() From 9096fc157bea32d3c3cdce9b3808a7cb3dcad329 Mon Sep 17 00:00:00 2001 From: BlackEagle Date: Wed, 9 Sep 2020 20:58:48 +0200 Subject: [PATCH 3/3] fix BufWinLeave for the main Vdebug windows Avoids trace: ``` Error detected while processing BufWinLeave Autocommands for "DebuggerBreakpoints": Traceback (most recent call last): File "", line 1, in 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 --- python3/vdebug/ui/vimui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python3/vdebug/ui/vimui.py b/python3/vdebug/ui/vimui.py index 47de27e..641f397 100644 --- a/python3/vdebug/ui/vimui.py +++ b/python3/vdebug/ui/vimui.py @@ -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)