File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -507,6 +507,11 @@ until it finds the file.
507
507
Enable this feature.
508
508
Type: `boolean ` , Default: `false`
509
509
510
+ *nvim-tree.update_focused_file.debounce_delay*
511
+ Idle milliseconds between BufEnter and update.
512
+ The last BufEnter will be focused, others are discarded.
513
+ Type: `number ` , Default: `50 ` (ms)
514
+
510
515
*nvim-tree.update_focused_file.update_root* (previously `update_focused_file.update_cwd` )
511
516
Update the root directory of the tree if the file is not under current
512
517
root directory. It prefers vim's cwd and `root_dirs` .
Original file line number Diff line number Diff line change @@ -398,7 +398,9 @@ local function setup_autocommands(opts)
398
398
if opts .update_focused_file .enable then
399
399
create_nvim_tree_autocmd (" BufEnter" , {
400
400
callback = function ()
401
- find_file (false )
401
+ utils .debounce (" BufEnter:find_file" , opts .update_focused_file .debounce_delay , function ()
402
+ find_file (false )
403
+ end )
402
404
end ,
403
405
})
404
406
end
@@ -571,6 +573,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
571
573
},
572
574
update_focused_file = {
573
575
enable = false ,
576
+ debounce_delay = 50 ,
574
577
update_root = false ,
575
578
ignore_list = {},
576
579
},
You can’t perform that action at this time.
0 commit comments