rxi / lite

A lightweight text editor written in Lua
MIT License
7.41k stars 352 forks source link

Disable indexing of certain directories #196

Open takase1121 opened 4 years ago

takase1121 commented 4 years ago

This will be really useful for large projects that has the dependencies in the same folder, like Node.js' node_modules folder. Instead, they can be indexed only when necessary (when clicked on them).

Tmpod commented 4 years ago

You can set exclude patterns in the config.ignore_files to make the project scan logic completely skip those files/directories. However, this is not dynamic and making it so might imply some fairly sized modifications. If I'm not mistaken, the scan thread continuously scans the current directory for changes, so it could be a matter of having some sort of command to modify the config on the fly, but that would be limiting. The issue here tho, is that the treeview plugin uses the core.project_files field which comes from the scan thread, meaning that if you set the config to ignore a certain pattern of file/directory, then it won't even show up in the treeview in the first place, so the whole clicking thing wouldn't work.

I suppose the best choice would be to set a limit on how deep to scan the project tree, and maybe also add some sort of lazy_directories field that makes the scanning logic acknowledge a directory, but not its contents, unless you specifically ask for them.

SwissalpS commented 4 years ago

suppose the best choice would be to set a limit on how deep to scan the project tree

Yes, I have projects that make lite use gigabytes of memory. A depth limit approach would already help a lot.