Skip to content

Float view doen't autoclose on opening a file #2624

Closed
@i-d-lytvynenko

Description

@i-d-lytvynenko

Description

When hitting enter with the cursor on a line with some file name, the file opens in a new buffer, but the nvim-tree doesn't autoclose. Upon trying to move cursor in the nvim-tree window, a number of errors pop up. For some reason the problem does not occur with hijack_cursor = false. The last commit without this bug is 96a783f.

Neovim version

NVIM v0.9.2
Build type: RelWithDebInfo
LuaJIT 2.1.1694082368

Operating system and version

Windows 10

Windows variant

No response

nvim-tree version

b8c3a23

Clean room replication

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=F:/nvt-min/site]]
local package_root = "F:/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "nvim-tree/nvim-tree.lua",
      "nvim-tree/nvim-web-devicons",
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

_G.setup = function()
  require("nvim-tree").setup {
    hijack_cursor = true,
    view = {
      float = {
        enable = true,
      },
    },
  }
end

Steps to reproduce

  1. nvim -nu F:/nvt-min/nvt-min.lua
  2. :e .
  3. Position cursor on some file
  4. Hit Enter

Expected behavior

No response

Actual behavior

No response

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