def get_listed_buffers(nvim_):
    """Get a list of buffers that haven't been deleted. `nvim.buffers` includes
    buffers that have had `:bdelete` called on them and aren't in the buffer
    list, so we have to filter those out.
    """
    return set(
        buf.number for buf in nvim_.buffers if nvim_.eval("buflisted(%d)" % buf.number)
    )