Skip to content

Commit

Permalink
feat(#2819): add actions.open_file.relative_path, default enabled, fo…
Browse files Browse the repository at this point in the history
…llowing successful experiment (#2995)
  • Loading branch information
alex-courtis authored Nov 9, 2024
1 parent 3fc8de1 commit 2ee1c5e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
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

0 comments on commit 2ee1c5e

Please sign in to comment.