-
-
Notifications
You must be signed in to change notification settings - Fork 639
Open
Labels
PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatednvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedperformanceperformance enhancementperformance enhancement
Description
Part of #3231 : Performance: Load Only Necessary Modules On setup and requiring API
Description
nvim-tree.lua Move all functions that do not relate to setup into another module.
Context
User requiring api.lua or executing setup results in most modules being required. This has a cost ~7-11ms.
This step involves moving functions that are not related to setup out of the main nvim-tree.lua module to reduce initial load time.
Notes
- This is not API so we may refactor at will
- Should be broken down into small changes to ameliorate risk and allow fast rollback
- Functions should be moved to
core.lua. If that is not possible, create a new moduleinternal.lua - This does not advance Multi Instance - Contributors Wanted - Please Take An Issue #2255, we are just moving functions that need to be addressed later
Implementation Plan
- Move
M.change_root - Move
M.tab_enter - Move
M.open_on_directory - Move
M.change_dir
Draft Test Plan, May Be Incomplete
-
Test
change_root(update_focused_file functionality)- Open nvim-tree
- Navigate to different files outside the current root
- Verify that tree root updates correctly based on
update_focused_fileconfig
-
Test
tab_enter(TabEnter autocmd)- Open nvim-tree in one tab
- Create new tabs and switch between them
- Verify nvim-tree appears correctly when entering tabs
-
Test
open_on_directory(BufEnter/BufNewFile autocmd)- Open nvim with a directory path (
nvim .) - Verify nvim-tree opens automatically based on
hijack_directoriesconfig
- Open nvim with a directory path (
-
Test
change_dir(DirChanged autocmd)- Use
:cdto change directories - Verify nvim-tree updates its root accordingly
- Test with
actions.change_dirconfig options
- Use
gegoune
Metadata
Metadata
Assignees
Labels
PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatednvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedperformanceperformance enhancementperformance enhancement