Skip to content

Externally Created File Not Always Visible #1731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alex-courtis opened this issue Nov 7, 2022 · 2 comments · Fixed by #1757
Closed

Externally Created File Not Always Visible #1731

alex-courtis opened this issue Nov 7, 2022 · 2 comments · Fixed by #1757
Labels
bug Something isn't working

Comments

@alex-courtis
Copy link
Member

alex-courtis commented Nov 7, 2022

Description

Creating a new file externally to vim does not always result in it being visible.

Neovim version

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

Operating system and version

Linux 6.0.6-arch1-1

nvim-tree version

a0f3e99

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/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 {}
end

Steps to reproduce

mkdir x
touch x/a
ln -s x a
ln -s x z

open each folder and close them

:!touch x/b

open each folder

Expected behavior

b visible in all folders

Actual behavior

b visible only in a

@alex-courtis alex-courtis added the bug Something isn't working label Nov 7, 2022
@alex-courtis
Copy link
Member Author

This may be specific to refresh_path however further testing, especially with watchers disabled will be necessary.

@alex-courtis
Copy link
Member Author

refresh with watchers disabled does not pick up the new file at all, although that may be considered reasonable.

alex-courtis added a commit that referenced this issue Nov 19, 2022
alex-courtis added a commit that referenced this issue Nov 20, 2022
alex-courtis added a commit that referenced this issue Nov 20, 2022
alex-courtis added a commit that referenced this issue Nov 26, 2022
* fix(#1731): watcher refreshes node rather than the first node matching absolute path, profile refresh

* fix(#1731): reload explorer reloads closed folders

* fix(#1731): do not fire folder created event on file create

* fix(#1731): reload profile absolute path, not link to

* fix(#1731): find-file locks/profiles on real path, reloads when watchers disabled

* Revert "fix(#1731): reload explorer reloads closed folders"

This reverts commit 5dfd8bd.

* fix(#1731): tidy watch reload

* fix(#1731): move refresh_node from watch to reload

* fix(#1731): find-file reloads all nodes for the containing directory

* fix(#1731): create-file refreshes synchronously

* fix(#1731): remove unused watch node

* fix(#1731): find-file refreshes root

* fix(#1716): create-file invokes find-file

* fix(#1731): refresh path walks down the tree to the targedt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant