File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
lua/nvim-tree/actions/tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -24,18 +24,19 @@ function M.fn(opts)
24
24
local bufnr , path
25
25
26
26
-- (optional) buffer number and path
27
- if type (opts .buf ) == " nil" then
27
+ local opts_buf = opts .buf
28
+ if type (opts_buf ) == " nil" then
28
29
bufnr = vim .api .nvim_get_current_buf ()
29
30
path = vim .api .nvim_buf_get_name (bufnr )
30
- elseif type (opts . buf ) == " number" then
31
- if not vim .api .nvim_buf_is_valid (opts . buf ) then
31
+ elseif type (opts_buf ) == " number" then
32
+ if not vim .api .nvim_buf_is_valid (opts_buf ) then
32
33
return
33
34
end
34
- bufnr = tonumber ( opts . buf )
35
+ bufnr = opts_buf
35
36
path = vim .api .nvim_buf_get_name (bufnr )
36
- elseif type (opts . buf ) == " string" then
37
+ elseif type (opts_buf ) == " string" then
37
38
bufnr = nil
38
- path = tostring (opts . buf )
39
+ path = tostring (opts_buf )
39
40
else
40
41
return
41
42
end
You can’t perform that action at this time.
0 commit comments