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

This commit is contained in:
Alexander Courtis 2024-11-09 14:44:59 +11:00 committed by GitHub
parent 3fc8de198c
commit 2ee1c5e17f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 17 deletions

View File

@ -592,6 +592,7 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
quit_on_open = false, quit_on_open = false,
eject = true, eject = true,
resize_window = true, resize_window = true,
relative_path = true,
window_picker = { window_picker = {
enable = true, enable = true,
picker = "default", picker = "default",
@ -631,11 +632,6 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
}, },
}, },
experimental = { experimental = {
actions = {
open_file = {
relative_path = false,
},
},
}, },
log = { log = {
enable = false, enable = false,
@ -1497,6 +1493,11 @@ Configuration options for opening a file from nvim-tree.
Resizes the tree when opening a file. Resizes the tree when opening a file.
Type: `boolean`, Default: `true` 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* *nvim-tree.actions.open_file.window_picker*
Window picker configuration. Window picker configuration.
@ -1625,12 +1626,6 @@ Confirmation prompts.
Experimental features that may become default or optional functionality. Experimental features that may become default or optional functionality.
In the event of a problem please disable the experiment and raise an issue. 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* 5.20 OPTS: LOG *nvim-tree-opts-log*
@ -2767,6 +2762,9 @@ Windows WSL and PowerShell
- Executable file detection is disabled as this is non-performant and can - Executable file detection is disabled as this is non-performant and can
freeze nvim freeze nvim
- Some filesystem watcher error related to permissions will not be reported - 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* 12. NETRW *nvim-tree-netrw*

View File

@ -451,6 +451,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
quit_on_open = false, quit_on_open = false,
eject = true, eject = true,
resize_window = true, resize_window = true,
relative_path = true,
window_picker = { window_picker = {
enable = true, enable = true,
picker = "default", picker = "default",
@ -490,11 +491,6 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
}, },
}, },
experimental = { experimental = {
actions = {
open_file = {
relative_path = false,
},
},
}, },
log = { log = {
enable = false, enable = false,

View File

@ -421,7 +421,7 @@ end
function M.setup(opts) function M.setup(opts)
M.quit_on_open = opts.actions.open_file.quit_on_open M.quit_on_open = opts.actions.open_file.quit_on_open
M.resize_window = opts.actions.open_file.resize_window 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 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() opts.actions.open_file.window_picker.chars = tostring(opts.actions.open_file.window_picker.chars):upper()
end end