-
-
Notifications
You must be signed in to change notification settings - Fork 620
Experimental Features: actions.open_file.relative_path #2819
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
Comments
I have been using this feature here for a while without any issues, but my usage scenario is relatively simple. As long as the absolute path of the file is converted to a relative path before specifying the: edit (etc.) command, it should theoretically be sufficiently secure. Based on this, I rechecked the code and found that there is an area that needs to be fixed. In if (mode == "preview" or mode == "preview_no_picker") and view.View.float.enable then
-- ignore "WinLeave" autocmd on preview
-- because the registered "WinLeave"
-- will kill the floating window immediately
set_current_win_no_autocmd(target_winid, { "WinLeave", "BufEnter" })
else
set_current_win_no_autocmd(target_winid, { "BufEnter" })
end
pcall(vim.api.nvim_cmd, command, { output = false })
lib.set_target_win() Can perform simple steps to reproduce this problem: :NvimTreeOpen
" jump to a window to open file
:lcd ..
" jump to NvimTree window and select a file to open This will open an incorrect path. I just make a PR to fix it. |
…ing change directory (#2820) fix issue with the description of epheien in #2819 Co-authored-by: eph <[email protected]>
Thanks @epheien I did expect several issues like these. We will fix them. |
I was looking for this. Thanks. I'll be using from now on and report if I find any issue. |
This is looking good... over a month and no issues. Are you happy to finish the experiment and make this the one and only way to open files @epheien ? |
This feature doesn't work on Windows at all. Other things like Telescope can open files relatively just fine on Windows, but not nvim-tree with this feature enabled. |
Many thanks for testing this one @wrldspawn , we don't have any means of testing windows. What happens when this feature is enabled? Is there a stack? I'd be grateful if you could raise a bug report so that I can attempt a fix for you to test. |
FWIW, I activated the feature on Windows. Works as expected for me 👍 🎉 |
Thanks for letting us know. Proposal:
Does that sound reasonable @gegoune ? |
Sounds good, @alex-courtis. It's been 'out there' for long enough and interested parties were using it without issues. I haven't personally so can't really add much to the issue, sorry. |
Thank you! |
…llowing successful experiment (#2995)
|
Experimental Features
nvim-tree has experimental features, previews of new functionality that will become default or optional functionality.
Please try these out and reply with your experiences. If you encounter a problem, please raise a bug report and indicate the experimental feature you are using.
#2127 Open Buffers With Relative Path (#2805)
Buffers opened by nvim-tree will use with relative paths instead of absolute.
Execute
:ls
to see the paths of all open buffers.:help nvim-tree.experimental.actions.open_file.relative_path
Enable:
2024 07 07 introduced, false by default
The text was updated successfully, but these errors were encountered: