@@ -190,7 +190,7 @@ local function open_file_in_tab(filename)
190
190
if M .quit_on_open then
191
191
view .close ()
192
192
end
193
- if require ( ' nvim-tree ' ). config . experimental . open .relative_path then
193
+ if M .relative_path then
194
194
filename = utils .path_relative (filename , vim .fn .getcwd ())
195
195
end
196
196
vim .cmd (" tabe " .. vim .fn .fnameescape (filename ))
@@ -200,7 +200,7 @@ local function drop(filename)
200
200
if M .quit_on_open then
201
201
view .close ()
202
202
end
203
- if require ( ' nvim-tree ' ). config . experimental . open .relative_path then
203
+ if M .relative_path then
204
204
filename = utils .path_relative (filename , vim .fn .getcwd ())
205
205
end
206
206
vim .cmd (" drop " .. vim .fn .fnameescape (filename ))
@@ -210,7 +210,7 @@ local function tab_drop(filename)
210
210
if M .quit_on_open then
211
211
view .close ()
212
212
end
213
- if require ( ' nvim-tree ' ). config . experimental . open .relative_path then
213
+ if M .relative_path then
214
214
filename = utils .path_relative (filename , vim .fn .getcwd ())
215
215
end
216
216
vim .cmd (" tab :drop " .. vim .fn .fnameescape (filename ))
@@ -320,7 +320,7 @@ local function open_in_new_window(filename, mode)
320
320
end
321
321
322
322
local fname
323
- if require ( ' nvim-tree ' ). config . experimental . open .relative_path then
323
+ if M .relative_path then
324
324
fname = utils .escape_special_chars (vim .fn .fnameescape (utils .path_relative (filename , vim .fn .getcwd ())))
325
325
else
326
326
fname = utils .escape_special_chars (vim .fn .fnameescape (filename ))
360
360
361
361
local function edit_in_current_buf (filename )
362
362
require (" nvim-tree.view" ).abandon_current_window ()
363
- if require ( ' nvim-tree ' ). config . experimental . open .relative_path then
363
+ if M .relative_path then
364
364
filename = utils .path_relative (filename , vim .fn .getcwd ())
365
365
end
366
366
vim .cmd (" keepalt keepjumps edit " .. vim .fn .fnameescape (filename ))
419
419
function M .setup (opts )
420
420
M .quit_on_open = opts .actions .open_file .quit_on_open
421
421
M .resize_window = opts .actions .open_file .resize_window
422
+ M .relative_path = opts .experimental .open .relative_path
422
423
if opts .actions .open_file .window_picker .chars then
423
424
opts .actions .open_file .window_picker .chars = tostring (opts .actions .open_file .window_picker .chars ):upper ()
424
425
end
0 commit comments