File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,15 @@ local function should_change_dir()
55
55
return M .options .enable and vim .tbl_isempty (vim .v .event )
56
56
end
57
57
58
- function M .force_dirchange (foldername , should_open_view )
59
- local ps = log .profile_start (" change dir %s" , foldername )
58
+ local function add_profiling_to (f )
59
+ return function (foldername , should_open_view )
60
+ local ps = log .profile_start (" change dir %s" , foldername )
61
+ f (foldername , should_open_view )
62
+ log .profile_end (ps , " change dir %s" , foldername )
63
+ end
64
+ end
60
65
66
+ M .force_dirchange = add_profiling_to (function (foldername , should_open_view )
61
67
if should_change_dir () then
62
68
cd (M .options .global , foldername )
63
69
end
@@ -69,9 +75,7 @@ function M.force_dirchange(foldername, should_open_view)
69
75
else
70
76
require (" nvim-tree.renderer" ).draw ()
71
77
end
72
-
73
- log .profile_end (ps , " change dir %s" , foldername )
74
- end
78
+ end )
75
79
76
80
function M .setup (options )
77
81
M .options = options .actions .change_dir
You can’t perform that action at this time.
0 commit comments