kyazdani42 / nvim-tree.lua

A file explorer tree for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nvim-tree is too wide when edit in a long path dir.

AGou-ops opened this issue · comments

OS
MacOS Monterey 12.1

Neovim version

NVIM v0.6.0
Build type: Release
LuaJIT 2.1.0-beta3
编译者 brew@HMBRW-A-001-M1-004.local

Features: +acl +iconv +tui
See ":help feature-compile"

     系统 vimrc 文件: "$VIM/sysinit.vim"
         $VIM 预设值: "/opt/homebrew/Cellar/neovim/0.6.0/share/nvim"

Run :checkhealth for more info

Nvim-tree version

> git log
commit 0aec64d56c9448a039408228d410a01c41125d48 (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Queensferry <queensferry.me@gmail.com>
Date:   Fri Dec 17 05:15:47 2021 +0800

    feat: set up view width/height with function (#848)

Describe the bug

When editing a long path file, the following occasionally occurs:

2021-12-24 10-51-43 2021-12-24 10_53_19

And short path file won't:

2021-12-24 10-53-48 2021-12-24 10_59_18

my user config:

...
  view = {
    width = 30,
    height = 30,
    hide_root_folder = false,
    side = 'left',
    auto_resize = false,
    mappings = {
      custom_only = false,
      list = {
          { key = {"<CR>", "<2-LeftMouse>"}, cb = tree_cb("edit") },
          { key = "v",                        cb = tree_cb("vsplit") },
          { key = "s",                        cb = tree_cb("split") },
          { key = "o",                            cb = tree_cb("system_open") },
      }
    },
    number = true,
    relativenumber = false,
    signcolumn = "yes"
  },
...

Expected behavior
The width does not change when editing the file.

I have this problem too.

Same OS and Neovim version as @AGou-ops

@AGou-ops @angarc, will setting view.auto_resize = true solves your problem?

Peek 2022-01-14 12-59

@fky2015 我的现在好了,之前设置了auto_resize也不管用,我觉得可能是与某个插件冲突了吧,但是不知道是哪一个.

@fky2015 Yep that worked for me, thanks!

@fky2015 that works for me too. Thanks

@fky2015 I have this problem too.
Neovim version v0.6.1
whatever the configuration of autoresize, or manually call commnad resize, it doesn't help me.
Only can fix that if do NvimTreeToggle.

@miraclemore a minimal config to see if i can reproduce your issue ? I autoresize is spelled auto_resize just in case.

ezoic increase your site revenue