Skip to content

Vim:E444: Cannot close last window #2191

Closed
@noahxzhu

Description

@noahxzhu

Description

E5108: Error executing lua: ...cal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/view.lua:205: Vim:E444: Cannot close last window
stack traceback:
[C]: in function 'nvim_win_close'
...cal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/view.lua:205: in function 'close'
...cal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/view.lua:214: in function 'close_this_tab_only'
...cal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/view.lua:227: in function 'close'
...y/nvim-tree.lua/lua/nvim-tree/actions/node/open-file.lua:348: in function 'fn'
...ocal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/api.lua:139: in function 'edit'
...ocal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/api.lua:149: in function 'f'
...ocal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/api.lua:32: in function <...ocal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/api.lua:30>

Neovim version

NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

macOS 13.3.1 (a)

nvim-tree version

270c955

Minimal config

{
      sync_root_with_cwd = true,
      respect_buf_cwd = true,
      renderer = {
        group_empty = true,
      },
      update_focused_file = {
        enable = true,
        update_root = true,
      },
      view = {
        adaptive_size = true,
        -- width = 40,
        float = {
          enable = false,
          open_win_config = {
            relative = "editor",
            border = "rounded",
            width = 40,
            height = 100000,
            row = 0,
            col = 0,
          },
        },
      },
      diagnostics = {
        enable = true,
      },
      actions = {
        open_file = {
          resize_window = true,
          quit_on_open = true,
        },
      },
      git = {
        ignore = false,
      },
    },

Steps to reproduce

I enable "actions.open_file.quit_on_open"

reproduce steps:

  1. enter a directory
  2. new a file
  3. open that file

if I disable the "quit_on_open", no this issue there.

Expected behavior

No response

Actual behavior

CleanShot.2023-05-06.at.23.10.01.mp4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions