def _on_delete_buf(self, data):
        # TODO: somehow tell the user about this
        buf_id = data['id']
        view = self.get_view(buf_id)
        try:
            if view:
                view = view.view
                view.set_scratch(True)
                G.WORKSPACE_WINDOW.focus_view(view)
                G.WORKSPACE_WINDOW.run_command("close_file")
        except Exception as e:
            msg.debug('Error closing view: %s' % unicode(e))
        try:
            buf = self.bufs.get(buf_id)
            if buf:
                del self.paths_to_ids[buf['path']]
                del self.bufs[buf_id]
        except KeyError:
            msg.debug('KeyError deleting buf id %s' % buf_id)
        super(self.__class__, self)._on_delete_buf(data)
dataset/ETHPy150Open Floobits/floobits-vim/plugin/floo/vim_handler.py/VimHandler._on_delete_buf/original