kyazdani42 / nvim-tree.lua

A file explorer tree for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ftplugin/NvimTree.lua always gets loaded

Zangetsu101 opened this issue · comments

OS
Ubuntu 20.04.3 LTS

Neovim version
NVIM v0.6.0

Nvim-tree version
0a2f6b0

Describe the bug
So I have a ftplugin for NvimTree which gets loaded even if I start neovim with just "nvim" command.
Also I wasn't able to set the option "vim.wo.cursorline = true" from this script for whatever reason.

To Reproduce

  1. Create a file ~/.config/nvim/after/ftplugin/NvimTree.lua
  2. Start neovim with "nvim"
  3. Run ":scriptnames" and the NvimTree.lua file should be there.

Expected behavior
The NvimTree.lua script should not have been loaded now should it?

Hi, indeed, buffer/window management is a bit weird, because the buffer is loaded only once thus loading related files on startup...
I'll fix this issue in the next weeks.
To set cursorline in the tree you could just:
require'nvim-tree.view'.View.winopts.cursorline = true

That worked. Thanks!
Is that documented somewhere?

It is not, but since i'm planning a lot of small refactorings, i'll be writing a new documentation afterwards.

closing this. By the way, now that the tree buffer is not hidden but destroyed and created you would be able to bind autocmd to it, and it would behave as expected.

ezoic increase your site revenue