From 4644154e5b98e8f79108e50f84b278c57903fc11 Mon Sep 17 00:00:00 2001 From: rxi Date: Sun, 17 May 2020 13:31:04 +0100 Subject: [PATCH] Added `config.ignore_files` Filenames that match either the single pattern provided by `config.ignore_files`, or any pattern in a table of patterns, will be ignored when lite is filling the `core.project_files` table Resolves #77 Resolves #102 --- data/core/config.lua | 1 + data/core/init.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/core/config.lua b/data/core/config.lua index c535a37..a9f106f 100644 --- a/data/core/config.lua +++ b/data/core/config.lua @@ -6,6 +6,7 @@ config.max_log_items = 80 config.message_timeout = 3 config.mouse_wheel_scroll = 50 * SCALE config.file_size_limit = 10 +config.ignore_files = "^%." config.symbol_pattern = "[%a_][%w_]*" config.non_word_chars = " \t\n/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-" config.undo_merge_timeout = 0.3 diff --git a/data/core/init.lua b/data/core/init.lua index 13c9c3a..777dd4e 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -1,4 +1,5 @@ require "core.strict" +local common = require "core.common" local config = require "core.config" local style = require "core.style" local command @@ -34,7 +35,7 @@ local function project_scan_thread() local dirs, files = {}, {} for _, file in ipairs(all) do - if not file:find("^%.") then + if not common.match_pattern(file, config.ignore_files) then local file = path .. PATHSEP .. file local info = system.get_file_info(file) if info and info.size < size_limit then