Re: snapopen

From: mitchell <c....at.caladbolg.net>
Date: Thu, 2 Sep 2010 09:55:33 -0700 (PDT)

Hi,

> The exclusive flag in the open function isn't checked for, I think. I
> added a hardcoded check for ".hg" directories in the add_directory
> function. (But if you don't use version control you probably don't
> need this.)

Fixed, thanks. I have updated the module to allow for excluding files
and folders by Lua pattern.

http://caladbolg.net/textadeptwiki/index.php?n=Main.Snapopen

Snippet:

-- @param filter A filter for files and folders to exclude. The filter
may be
-- a string or table. Each filter is a Lua pattern. Any files
matching a
-- filter are excluded. Prefix a pattern with '!' to exclude any
files that
-- do not match the filter. Directories can be excluded by adding
filters to
-- a table assigned to a 'folders' key in the filter table.

Examples:

-- local snapopen = _m.textadept.snapopen

--
--     -- Show all files in PATHS.
--     snapopen()
--
--     -- Show all files in the current file's directory.
--     snapopen(buffer.filename:match('^.+[/\\]'), nil, true)
--
--     -- Show all Lua files in PATHS.
--     snapopen(nil, '!%.lua$')
--
--     -- Ignore the .hg folder in the local Mercurial repository.
--     local project_dir = '/path/to/project'
--     snapopen(project_dir, { folders = { '.hg' } }, true)
Received on Thu 02 Sep 2010 - 12:55:33 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:49:41 EST