klen / nvim-config-local

Secure load local config files for neovim
MIT License
151 stars 9 forks source link

Detection of local config file broke in some commit between tags 1.1.1 and 1.2.0 when opening a file #6

Closed krishnakumarg1984 closed 1 year ago

krishnakumarg1984 commented 2 years ago

@klen In some commit between tags 1.1.1 and 1.2.0, the plugin has broken. i.e. the detection of local configuration files doesn't happen correctly.

To reproduce

  1. Install nvim-config-local with its default config for the setup{}. In particular, ensure that verbose messages about local config loading is present i.e. not silent.
  2. Project is my_cpp_project and is git tracked. i.e. there is the usual .git folder in this directory
  3. Add a .vimrc.lua file in this project root. Maybe set something non-default, but trivial vim.g.list = true perhaps
  4. Open nvim without any file args, or even nvim .vimrc.lua. The local config is correctly set. Mark this file as trusted.
  5. Now create a folder called src within the project i.e. my_cpp_project/src.
  6. Staying in my_cpp_project folder, edit a simple c++ file, say hello_world.cpp and close it afterwards.
  7. Now, reopen nvim src/hello_world.cpp. We can see that the local config folder detection has not happened, and list chars are not present. Furthermore, issuing :messages confirms to us that the root file detection has not happened.
  8. :ConfigEdit etc command works fine even after the local vimrc detection failed. The plugin also works fine when opening nvim at the project root without any arguments whatsoever. It also works fine when issuing nvim .vimrc.lua (i.e. the trusted local config file is detected and loaded) and thereafter editing the C++ file in the subfolder works fine (i.e. uses the local rc settings).

Now repeat the steps 1-6 above with plugin version tag 1.1.1. Everything works fine. Repeat with plugin version tag 1.2.0. It breaks as per above description.

listout commented 2 years ago

Can confirm, facing this. @klen please help.

krishnakumarg1984 commented 2 years ago

@listout This repository looks abandoned.

A more modern lua based replacement https://github.com/MunifTanjim/exrc.nvim is working well for me.

klen commented 1 year ago

@krishnakumarg1984 Thank you for the report. The issue has been fixed.