Browse Source

Improve user feedback for big directories (#223)

pull/269/head
Janis-Leuenberger 1 year ago committed by GitHub
parent
commit
1394c53dbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      data/core/config.lua
  2. 9
      data/core/init.lua
  3. 7
      doc/usage.md

2
data/core/config.lua

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

9
data/core/init.lua

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

7
doc/usage.md

@ -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 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
In addition to the project directories it is possible to add other directories

Loading…
Cancel
Save