Improve user feedback for big directories (#223)

This commit is contained in:
Janis-Leuenberger 2021-05-27 08:28:58 +02:00 committed by GitHub
parent f1a4bf8218
commit 1394c53dbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View File

@ -3,7 +3,7 @@ local config = {}
config.project_scan_rate = 5 config.project_scan_rate = 5
config.fps = 60 config.fps = 60
config.max_log_items = 80 config.max_log_items = 80
config.message_timeout = 3 config.message_timeout = 5
config.mouse_wheel_scroll = 50 * SCALE config.mouse_wheel_scroll = 50 * SCALE
config.file_size_limit = 10 config.file_size_limit = 10
config.ignore_files = "^%." config.ignore_files = "^%."

View File

@ -173,11 +173,10 @@ local function project_scan_thread()
if entries_count > config.max_project_files then if entries_count > config.max_project_files then
core.project_files_limit = true core.project_files_limit = true
core.status_view:show_message("!", style.accent, core.status_view:show_message("!", style.accent,
"Too many files in project directory: stopping reading at ".. "Too many files in project directory: stopped reading at "..
config.max_project_files.." files according to config.max_project_files. ".. config.max_project_files.." files. For more information see "..
"Either tweak this variable, or ignore certain files/directories by ".. "usage.md at github.com/franko/lite-xl."
"using the config.ignore_files variable in your user plugin or ".. )
"project config.")
end end
dir.files = t dir.files = t
core.redraw = true core.redraw = true

View File

@ -71,6 +71,13 @@ The project module can be edited by running the `core:open-project-module`
command — if the module does not exist for the current project when the command — if the module does not exist for the current project when the
command is run it will be created. command is run it will be created.
## Big directories
Often projects contain compiled, bundled or downloaded files which you don't want to edit. These files can be excluded from projects by configuring `config.ignore_files`. Such a configuration might look like `config.ignore_files = { "^%.", "node_modules" }`. This will exclude the `node_modules` folder and any file starting with `.`. You can add this to a user or project module.
If a project has more files than the maximum (configured with `config.max_project_files`) lite-xl will switch to a different mode where files are lazily loaded.
_Note: Because of lazy loading `core:find-file` will open `core:open-file` instead._
## Add directories to a project ## Add directories to a project
In addition to the project directories it is possible to add other directories In addition to the project directories it is possible to add other directories