nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua
Other
7.17k stars 609 forks source link

NvimTree no longer has a fixed width #992

Closed siduck closed 2 years ago

siduck commented 2 years ago

I updated nvimtree plugin yesterday and now my nvim is fullscreen :/

image

HenryCROSS commented 2 years ago

I suffered the same issue. Also, it somehow crashes the neovim when I hit the keybinding slowly when it is in the dashboard.

gegoune commented 2 years ago

It's a feature. People wanted full screen tree and that's what it is I think.

konart commented 2 years ago

It's a feature. People wanted full screen tree and that's what it is I think.

Features shouldn't break the old behaviour. Not without a notice at least.

kyazdani42 commented 2 years ago

Well yes it's a feature that fixed a lot of issues :smile: i pushed 76d4ed5 which should let you set hijack_unnamed_buffer_when_opening = false during setup

siduck commented 2 years ago

Well yes it's a feature that fixed a lot of issues smile i pushed 76d4ed5 which should let you set hijack_unnamed_buffer_when_opening = false during setup

i added that line to the setup but it still doesnt work :(

kyazdani42 commented 2 years ago

if you open with vim . or vim dir, nvim-tree hijacks the directory buffer and opens fullscreen

siduck commented 2 years ago

if you open with vim . or vim dir, nvim-tree hijacks the directory buffer and opens fullscreen

I just open neovim ( run nvim command ) and then do nvimtreetoggle, the default behaviour must have a fixed width like before at least.. Also I tried vim . , it opens the tree with fixed width for the first time and then opens fullscreen, cant I always keep the fixed width like before?

kyazdani42 commented 2 years ago

i fixed the issue when opening manually. Does it fix your issue ?

siduck commented 2 years ago

i fixed the issue when opening manually. Does it fix your issue ?

thx it works now! but nvimtreetoggle doesnt close with ( opening a dir with nvim i.e nvim command )

https://user-images.githubusercontent.com/59060246/154493439-546b4c14-2245-4600-8505-077ce6a1a002.mp4

kyazdani42 commented 2 years ago

i do not understand this issue @siduck. Could you open an issue with a good explanation of the problem ? Your example is a bit too fast :smile:

siduck commented 2 years ago

i do not understand this issue @siduck. Could you open an issue with a good explanation of the problem ? Your example is a bit too fast smile

oh i meant, nvimtreetoggle stopped working when i opened neovim with a dir i.e nvim dirname . but it works when i just open neovim and then do nvimtreetoggle

kyazdani42 commented 2 years ago

please open a new issue ? i'm not sure of the steps to reproduce since this issue has gone beyond its original subject.

batusai513 commented 2 years ago

@kyazdani42 is there a way to not have the behaviour of opening full screen when running :NvimTreeToggle after opening nvim with nvim .? I've already added hijack_unnamed_buffer_when_opening = false and it is not working (still open full screen when there are no files opened).

here is my config:

local config = {
  disable_netrw = true,
  hijack_netrw = true,
  open_on_setup = false,
  ignore_buffer_on_setup = false,
  ignore_ft_on_setup = {
    "startify",
    "dashboard",
    "alpha",
  },
  auto_reload_on_write = true,
  hijack_unnamed_buffer_when_opening = false,
    hijack_directories = {
        enable = true,
        auto_open = false,
    },
  auto_close = false,
  open_on_tab = false,
  hijack_cursor = false,
  update_cwd = false,
  diagnostics = diagnosticsConfig,
  update_focused_file = {
    enable = true,
    update_cwd = false,
    ignore_list = {},
  },
    system_open = {
        cmd = nil,
        args = {},
    },
    git = {
        enable = true,
        ignore = false,
        timeout = 500,
    },
  view = {
    width = 30,
    height = 30,
    hide_root_folder = false,
    side = "right",
    auto_resize = false,
    mappings = {
      custom_only = false,
      list = {
        { key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
        { key = "h", cb = tree_cb "close_node" },
        { key = "v", cb = tree_cb "vsplit" },

      },
    },
    number = false,
    relativenumber = false,
        signcolumn = "yes",
  },
    filters = {
        dotfiles = false,
        custom = { "node_modules", ".cache" },
    },
    trash = {
        cmd = "trash",
        require_confirm = true,
    },
    actions = {
        change_dir = {
            global = false,
        },
        open_file = {
            quit_on_open = false,
        },
        window_picker = {
            enable = true,
            chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
      exclude = {
        filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame", },
        buftype  = { "nofile", "terminal", "help", },
      }
        },
    },
  quit_on_open = 0,
}

thanks for your help

kyazdani42 commented 2 years ago

disable hijack_directories. nvim . opens the current directory so it hijacks it.