nvim-tree.lua icon indicating copy to clipboard operation
nvim-tree.lua copied to clipboard

When new buffer opens from tree file list, it creates half-split ignoring width setting

Open flppv opened this issue 2 years ago • 3 comments

Description

When on the screen there is only a file tree, upon opening the file it opens a tab on the right half of the window, and nvim-tree takes a left half, even with width setting being set. Toggling nvim-tree twice (close-open) shrinks it to a width-value width.

Neovim version

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

Operating system and version

macOS 12.4

nvim-tree version

08ab346

Minimal config

-

Steps to reproduce

  1. Open any directory with nvim
  2. Select a file within nvim-tree sidebar
  3. Hit Enter

Expected behavior

Opened tab takes full-width - nvim-tree-width width, and nvim-tree takes nvim-tree-width width

Actual behavior

Opened tab takes 50% width, and nvim-tree 50% width

flppv avatar Aug 20 '22 02:08 flppv

This sounds like a bug.

Please create a minimal config nvt-min.lua that we may use to replicate and (fix or provide a workaround for).

alex-courtis avatar Aug 20 '22 04:08 alex-courtis

@alex-courtis it's a clean lunarvim config

flppv avatar Aug 25 '22 01:08 flppv

Lunarvim is extremely far from a minimal config. Open the link Alex gave you.

0styx0 avatar Aug 25 '22 22:08 0styx0

I think I'm facing the same problem

Steps to reproduce the issue:

  1. Open directory as the following:
nvim .
  1. Then open any file (Enter or o).
  2. image
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by nixbld

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/jnfqzl7lzqshbqfm9mkl27024nsbcgvz-neovim-unwrapped-0.7.2/share/nvim
"

Run :checkhealth for more info

My neovim configuration

nvim-tree configuration

P.S. I tried neovim with a minimal configuration (only nvim-tree)

pleshevskiy avatar Sep 20 '22 09:09 pleshevskiy

I found a workaround to use <C-o> to open the first file. But it would be great if o didn't push sidebar to the right.

pleshevskiy avatar Sep 20 '22 11:09 pleshevskiy

https://github.com/kyazdani42/nvim-tree.lua/pull/1594 fixed my problem :)

pleshevskiy avatar Sep 21 '22 05:09 pleshevskiy

Thanks @pleshevskiy , merged.

@flppv please update nvim-tree.lua and see if it resolves the issue.

alex-courtis avatar Sep 21 '22 23:09 alex-courtis

@alex-courtis unfortunately I got rid from LunarVim where this bug occured for me, and started using my own clean config, I hadn't issue with width there, but I had with tree changing side to right, which is resolved with new update. I assume I can close this issue

flppv avatar Sep 22 '22 12:09 flppv

started using my own clean config

Fantastic! LunarVim does do a lot...

alex-courtis avatar Sep 23 '22 01:09 alex-courtis