def _quit_buffer(self) -> None:
    self._cleanup()
    if (self._vim.call('bufwinnr', self._bufnr) < 0):
        return
    winids = self._vim.call('win_findbuf', self._vim.vars['denite#_filter_bufnr'])
    if winids:
        self._vim.call('win_gotoid', winids[0])
        self._close_current_window()
        self._vim.call('win_gotoid', self._winid)
    if (self._context['split'] == 'no'):
        self._switch_prev_buffer()
        for (k, v) in self._save_window_options.items():
            self._vim.current.window.options[k] = v
    else:
        if (self._context['split'] == 'tab'):
            self._vim.command('tabclose!')
        if (self._context['split'] != 'tab'):
            self._close_current_window()
        self._vim.call('win_gotoid', self._prev_winid)
    self._vim.call('setpos', '.', self._prev_curpos)
    if (self._get_wininfo() and (self._get_wininfo() == self._prev_wininfo)):
        self._vim.command(self._winrestcmd)
        self._vim.command(self._winrestcmd)
    clearmatch(self._vim)
def _quit_buffer(self) -> None:
    self._cleanup()
    if (self._vim.call('bufwinnr', self._bufnr) < 0):
        return
    winids = self._vim.call('win_findbuf', self._vim.vars['denite#_filter_bufnr'])
    if winids:
        self._vim.call('win_gotoid', winids[0])
        self._close_current_window()
        self._vim.call('win_gotoid', self._winid)
    if (self._context['split'] == 'no'):
        self._switch_prev_buffer()
        for (k, v) in self._save_window_options.items():
            self._vim.current.window.options[k] = v
    else:
        if (self._context['split'] == 'tab'):
            self._vim.command('tabclose!')
        if (self._context['split'] != 'tab'):
            self._close_current_window()
        self._vim.call('win_gotoid', self._prev_winid)
    self._vim.call('setpos', '.', self._prev_curpos)
    if (self._get_wininfo() and (self._get_wininfo() == self._prev_wininfo)):
        self._vim.command(self._winrestcmd)
        self._vim.command(self._winrestcmd)
    clearmatch(self._vim)