Skip to content

Commit 2ee1c5e

Browse files
authored
feat(#2819): add actions.open_file.relative_path, default enabled, following successful experiment (#2995)
1 parent 3fc8de1 commit 2ee1c5e

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

Diff for: doc/nvim-tree-lua.txt

+9-11
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
592592
quit_on_open = false,
593593
eject = true,
594594
resize_window = true,
595+
relative_path = true,
595596
window_picker = {
596597
enable = true,
597598
picker = "default",
@@ -631,11 +632,6 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
631632
},
632633
},
633634
experimental = {
634-
actions = {
635-
open_file = {
636-
relative_path = false,
637-
},
638-
},
639635
},
640636
log = {
641637
enable = false,
@@ -1497,6 +1493,11 @@ Configuration options for opening a file from nvim-tree.
14971493
Resizes the tree when opening a file.
14981494
Type: `boolean`, Default: `true`
14991495

1496+
*nvim-tree.experimental.actions.open_file.relative_path*
1497+
Buffers opened by nvim-tree will use with relative paths instead of
1498+
absolute.
1499+
Type: `boolean`, Default: `true`
1500+
15001501
*nvim-tree.actions.open_file.window_picker*
15011502
Window picker configuration.
15021503

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

1628-
*nvim-tree.experimental.actions.open_file.relative_path*
1629-
Buffers opened by nvim-tree will use with relative paths instead of
1630-
absolute.
1631-
Execute |:ls| to see the paths of all open buffers.
1632-
Type: `boolean`, Default: `false`
1633-
16341629
==============================================================================
16351630
5.20 OPTS: LOG *nvim-tree-opts-log*
16361631

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

27712769
==============================================================================
27722770
12. NETRW *nvim-tree-netrw*

Diff for: lua/nvim-tree.lua

+1-5
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
451451
quit_on_open = false,
452452
eject = true,
453453
resize_window = true,
454+
relative_path = true,
454455
window_picker = {
455456
enable = true,
456457
picker = "default",
@@ -490,11 +491,6 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
490491
},
491492
},
492493
experimental = {
493-
actions = {
494-
open_file = {
495-
relative_path = false,
496-
},
497-
},
498494
},
499495
log = {
500496
enable = false,

Diff for: lua/nvim-tree/actions/node/open-file.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ end
421421
function M.setup(opts)
422422
M.quit_on_open = opts.actions.open_file.quit_on_open
423423
M.resize_window = opts.actions.open_file.resize_window
424-
M.relative_path = opts.experimental.actions.open_file.relative_path
424+
M.relative_path = opts.actions.open_file.relative_path
425425
if opts.actions.open_file.window_picker.chars then
426426
opts.actions.open_file.window_picker.chars = tostring(opts.actions.open_file.window_picker.chars):upper()
427427
end

0 commit comments

Comments
 (0)