aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2018-11-26 16:56:58 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2018-11-26 16:56:58 -0500
commit24de6b2672d6f653e7d0691482e96bfc43b179ef (patch)
tree5d18ad318437d3209ccb4c5b8d59a6d2ec95e27c /core/file_io.lua
parentcfb7aee3491245e62d81aac8f9d3948ca19af266 (diff)
downloadtextadept-24de6b2672d6f653e7d0691482e96bfc43b179ef.tar.gz
textadept-24de6b2672d6f653e7d0691482e96bfc43b179ef.zip
Changed filter format to be more flat and intuitive.
Filters are now simply lists of inclusive and exclusive patterns. Added temporary compatibility and notice for old-style filters.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua31
1 files changed, 11 insertions, 20 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index c7fc3472..701b6940 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -382,23 +382,14 @@ io.quick_open_filters = {}
-- directory path or list of directory paths, using a filtered list dialog.
-- If *paths* is `nil`, uses the current project's root directory, which is
-- obtained from `io.get_project_root()`.
--- Files shown in the dialog do not match any pattern in either string or table
--- *filter* (or `lfs.default_filter` if *filter* is `nil`). A filter table
--- contains:
---
--- + Lua patterns that match filenames to exclude.
--- + Optional `folders` sub-table that contains patterns matching directories
--- to exclude.
--- + Optional `extensions` sub-table that contains raw file extensions to
--- exclude.
--- + Optional `symlink` flag that when `true`, excludes symlinked files (but
--- not symlinked directories).
--- + Optional `folders.symlink` flag that when `true`, excludes symlinked
--- directories.
---
--- Any filter patterns starting with '!' exclude files and directories that do
--- not match the pattern that follows. The number of files in the list is capped
--- at `quick_open_max`.
+-- String or list *filter* determines which files to show in the dialog, with
+-- the default filter being `lfs.default_filter`. A filter consists of Lua
+-- patterns that match file and directory paths to include or exclude. Exclusive
+-- patterns begin with a '!'. If no inclusive patterns are given, any path is
+-- initially considered. As a convenience, file extensions can be specified
+-- literally instead of as a Lua pattern (e.g. '.lua' vs. '%.lua$'), and '/'
+-- also matches the Windows directory separator ('[/\\]' is not needed).
+-- The number of files in the list is capped at `quick_open_max`.
-- If *filter* is `nil` and *paths* is ultimately a string, the filter from the
-- `io.quick_open_filters` table is used in place of `lfs.default_filter` if the
-- former exists.
@@ -414,10 +405,10 @@ io.quick_open_filters = {}
-- `ui.dialogs.filteredlist()`.
-- @usage io.quick_open(buffer.filename:match('^.+/')) -- list all files in the
-- current file's directory, subject to the default filter
--- @usage io.quick_open(io.get_current_project(), '!%.lua$') -- list all Lua
+-- @usage io.quick_open(io.get_current_project(), '%.lua$') -- list all Lua
-- files in the current project
--- @usage io.quick_open(io.get_current_project(), {folders = {'build'}}) -- list
--- all non-built files in the current project
+-- @usage io.quick_open(io.get_current_project(), '![/\\]build') -- list all
+-- files in the current project except those in the build directory
-- @see io.quick_open_filters
-- @see lfs.default_filter
-- @see quick_open_max