Issues
Feature description
Hi 😄 and thank you for your work on this amazing plugin 🥳
I discovered that :Rest env select searches downward from the current buffer's directory. That is surprising to me as most tools search upward stopping at the project root like when finding a .git directory. find_env_files searches downward due to
|
end, { limit = math.huge, type = "file", path = "./" }) |
(https://neovim.io/doc/user/lua.html#vim.fs.find() upward=false by default)
This prevents me from reusing .env files at the root of a project with .http files in nested dirs. I can only make it work if I keep the :cd at the project's root. However, that adds .env files in nested dirs that are irrelevant IMHO.
Imagine a project with
-
.env
-
./a
-
./a/.env
-
./a/a.http
-
./b/b.http
-
When opening b.http from directory ./b (or doing :cd ./b) the root .env is not shown in the select UI.
-
When opening b.http from the root dir ./a/.env is shown in the select UI while from my point of view, its meant to be scoped to ./a
I assume you are open to changes here due to your comment
https://github.com/rest-nvim/rest.nvim/blob/62606c3599bd304227457d6e20580965939b191e/lua/rest-nvim/dotenv.lua#L61C1-L62C63
😋
Changing the search direction is a breaking change so I wonder if we could make this
https://github.com/rest-nvim/rest.nvim/blob/62606c3599bd304227457d6e20580965939b191e/lua/rest-nvim/dotenv.lua#L58C1-L58C28
a configurable function with this one staying the default? Maybe you also have different suggestion 👌🏻
Please let me know what you think! I could give it a try at implementing it if you would want. Thank you again!!
Issues
Feature description
Hi 😄 and thank you for your work on this amazing plugin 🥳
I discovered that
:Rest env selectsearches downward from the current buffer's directory. That is surprising to me as most tools search upward stopping at the project root like when finding a .git directory.find_env_filessearches downward due torest.nvim/lua/rest-nvim/dotenv.lua
Line 65 in 62606c3
(https://neovim.io/doc/user/lua.html#vim.fs.find()
upward=falseby default)This prevents me from reusing
.envfiles at the root of a project with.httpfiles in nested dirs. I can only make it work if I keep the:cdat the project's root. However, that adds.envfiles in nested dirs that are irrelevant IMHO.Imagine a project with
.env
./a
./a/.env
./a/a.http
./b/b.http
When opening
b.httpfrom directory./b(or doing:cd ./b) the root.envis not shown in the select UI.When opening
b.httpfrom the root dir./a/.envis shown in the select UI while from my point of view, its meant to be scoped to./aI assume you are open to changes here due to your comment
https://github.com/rest-nvim/rest.nvim/blob/62606c3599bd304227457d6e20580965939b191e/lua/rest-nvim/dotenv.lua#L61C1-L62C63
😋
Changing the search direction is a breaking change so I wonder if we could make this
https://github.com/rest-nvim/rest.nvim/blob/62606c3599bd304227457d6e20580965939b191e/lua/rest-nvim/dotenv.lua#L58C1-L58C28
a configurable function with this one staying the default? Maybe you also have different suggestion 👌🏻
Please let me know what you think! I could give it a try at implementing it if you would want. Thank you again!!