Skip to content

feat(#2819): add actions.open_file.relative_path, default enabled, following successful experiment #2995

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

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions doc/nvim-tree-lua.txt
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
quit_on_open = false,
eject = true,
resize_window = true,
relative_path = true,
window_picker = {
enable = true,
picker = "default",
Expand Down Expand Up @@ -631,11 +632,6 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
},
},
experimental = {
actions = {
open_file = {
relative_path = false,
},
},
},
log = {
enable = false,
Expand Down Expand Up @@ -1497,6 +1493,11 @@ Configuration options for opening a file from nvim-tree.
Resizes the tree when opening a file.
Type: `boolean`, Default: `true`

*nvim-tree.experimental.actions.open_file.relative_path*
Buffers opened by nvim-tree will use with relative paths instead of
absolute.
Type: `boolean`, Default: `true`

*nvim-tree.actions.open_file.window_picker*
Window picker configuration.

Expand Down Expand Up @@ -1625,12 +1626,6 @@ Confirmation prompts.
Experimental features that may become default or optional functionality.
In the event of a problem please disable the experiment and raise an issue.

*nvim-tree.experimental.actions.open_file.relative_path*
Buffers opened by nvim-tree will use with relative paths instead of
absolute.
Execute |:ls| to see the paths of all open buffers.
Type: `boolean`, Default: `false`

==============================================================================
5.20 OPTS: LOG *nvim-tree-opts-log*

Expand Down Expand Up @@ -2767,6 +2762,9 @@ Windows WSL and PowerShell
- Executable file detection is disabled as this is non-performant and can
freeze nvim
- Some filesystem watcher error related to permissions will not be reported
- Some users have reported unspecified issues with
|nvim-tree.experimental.actions.open_file.relative_path|. Please report any
issues or disable this feature.

==============================================================================
12. NETRW *nvim-tree-netrw*
Expand Down
6 changes: 1 addition & 5 deletions lua/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
quit_on_open = false,
eject = true,
resize_window = true,
relative_path = true,
window_picker = {
enable = true,
picker = "default",
Expand Down Expand Up @@ -490,11 +491,6 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
},
},
experimental = {
actions = {
open_file = {
relative_path = false,
},
},
},
log = {
enable = false,
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/actions/node/open-file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ end
function M.setup(opts)
M.quit_on_open = opts.actions.open_file.quit_on_open
M.resize_window = opts.actions.open_file.resize_window
M.relative_path = opts.experimental.actions.open_file.relative_path
M.relative_path = opts.actions.open_file.relative_path
if opts.actions.open_file.window_picker.chars then
opts.actions.open_file.window_picker.chars = tostring(opts.actions.open_file.window_picker.chars):upper()
end
Expand Down
Loading