Giter Site home page Giter Site logo

Comments (7)

gegoune avatar gegoune commented on May 10, 2024 1

Your video doesn't load for me. Also they are not very helpful in the first place anyway, we are not sure what you are trying to show, reproducible steps are way better, but you failed to provide them twice. You have also choose not to provide all other essential information as per our bug reporting form (https://github.com/nvim-tree/nvim-tree.lua/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml); that, and the fact that neither of us has access to Windows machine makes it impossible to try to help with your issue. Please open new issue, with all required information filled in, but instead of using configuration file from bug report form please us this snippet (put it into nvt-min.lua instead):

for name, url in pairs {
  tree = 'https://github.com/nvim-tree/nvim-tree.lua.git',
  devicons = 'https://github.com/nvim-tree/nvim-web-devicons.git',
} do
  local install_path = vim.fn.fnamemodify('/tmp/nvim_issue/' .. name, ':p')  -- TODO: Please change the path here!!! 
  if vim.fn.isdirectory(install_path) == 0 then vim.fn.system { 'git', 'clone', '--depth=1', url, install_path } end
  vim.opt.runtimepath:append(install_path)
end

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

require('nvim-tree').setup()
print 'Minimal Config Ready!'

Please pay attention to line with install_path, you will need to change it so it works on Windows.

from nvim-tree.lua.

gegoune avatar gegoune commented on May 10, 2024

Please provide reproducible configuration and steps as per https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting#clean-room-replication.

from nvim-tree.lua.

peter-lyr avatar peter-lyr commented on May 10, 2024

I followed nvt-min.lua, and it's unable to reproduce the problem.
But I can reproduce the problem on lazy.nvim when I open nvim-qt.exe.
In addition, if I open nvim.exe in powershell, the problem can't be reproduce.

But I've gotten used to using lazy.nvim instead of packer.nvim.

Here is my config:

2023-07-22.01-31-58.1.mp4

image

$localappdata/nvim/init.lua:

vim.g.mapleader = " "

local vimruntime = vim.fn.expand("$VIMRUNTIME")
local pack = vimruntime .. '\\pack\\'

local lazypath = pack .. "lazy\\start\\lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
  vim.opt.rtp:prepend(lazypath)
end

require('lazy').setup({
  spec = {
    { import = 'nvt-min' },
  },
  root = pack .. "lazy\\plugins",
})

local file = require('plenary.path'):new(pack):joinpath('nvim_config', 'test.log').filename

pcall(vim.api.nvim_del_autocmd, vim.g.test_au1)

vim.g.test_au1 = vim.api.nvim_create_autocmd({
  "CursorMoved",
  "TextChanged",
  "OptionSet",
}, {
  callback = function(ev)
    vim.fn.writefile({ string.format([[%-3.3f %-2d %-20s - "%s"]], os.clock(), ev.buf, ev.event, ev.file) }, file, 'a')
  end,
})

share\nvim\runtime\pack\nvim_config\start\lazy\lua\nvt-min\nvimtree.lua:

return {
  'nvim-tree/nvim-tree.lua',
  dependencies = {
    'nvim-tree/nvim-web-devicons',
    'nvim-lua/plenary.nvim',
  },
  config = function()
    require('nvim-tree').setup({})
  end,
}

from nvim-tree.lua.

alex-courtis avatar alex-courtis commented on May 10, 2024

But I can reproduce the problem on lazy.nvim when I open nvim-qt.exe.

Are there any plugins other than nvim-tree running under that configuration? If so it's likely that they are be the cause.

My opinion:

Lazy solves a problem that doesn't exist, but adds a great deal of complexity (actual plugin loading) as well as configuration complexity.

Perhaps you might profile startup time / load with lazy running and with a regular, eager plugin manager. If there is an order of magnitude or two difference AND lazy loading doesn't affect your experience at runtime with pauses etc., then you might have a case for lazy.

I've never received an answer when asking a lazy user to profile their startup with/without lazy.

from nvim-tree.lua.

gegoune avatar gegoune commented on May 10, 2024

I am going to close this issue now. It's not reproducible without additional plugins. If there is conflict between nvim-tree and some other conflict there might be something actionable by us, otherwise there isn't much we can do.

You could check what auto commands are firing and see where they are coming from. That should help narrowing the issue.

(We could improve minimal config, especially use of NVIM_APPNAME, see NeogitOrg/neogit#621 for some details.)

from nvim-tree.lua.

peter-lyr avatar peter-lyr commented on May 10, 2024
2023-07-22.22-17-16.mp4

I reproduce this problem maybe in packer.nvim.

Here is my new computer, there is only one folder in my Desktop containing nvim-win64 and nvt-min\nvt-min.lua:

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

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=C:\Users\llydr\Desktop\nv\nvt-min\site]]
local package_root = [[C:\Users\llydr\Desktop\nv\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",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    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

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {}
  local file = [[C:\Users\llydr\Desktop\nv\nvt-min\nvt-min.log]]
  pcall(vim.api.nvim_del_autocmd, vim.g.test_au1)
  vim.g.test_au1 = vim.api.nvim_create_autocmd({
    "CursorMoved",
    "TextChanged",
    "OptionSet",
  }, {
    callback = function(ev)
      vim.fn.writefile({ string.format([[%-3.3f %-2d %-20s - "%s"]], os.clock(), ev.buf, ev.event, ev.file) }, file, 'a')
    end,
  })
end

OptionSet is not always triggered. It seems to have something to do with git, but I'm not sure.

Thanks!

from nvim-tree.lua.

alex-courtis avatar alex-courtis commented on May 10, 2024

(We could improve minimal config, especially use of NVIM_APPNAME, see NeogitOrg/neogit#621 for some details.)

Nice... it sounds like it's time. The packer auto load is sometimes quite problematic.

I've had to stray quite far from the minimal configuration for my dev/replication setup: https://github.com/alex-courtis/arch/blob/02507049a79a230febbf4aa9c0ff73deb1331bf5/config/nvim/nvt-dev-template.lua

from nvim-tree.lua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.