Hi,
I'm using your filemanager2 plugin and I love the improvements. However, I encountered a challenge when working in directories with problematic symlinks (e.g., disconnected network mounts or broken docker registries) or in environments where I don't have a Git repository.
Currently, the plugin relies on Git for ignoring files. In my setup, I implemented a surgical solution that adds a local ignore file support:
- New Option:
filemanager2.hideassets (true/false) to toggle custom filtering.
- Custom Ignore File: A simple
.filemanager-ignore file located in the plugin directory where users can list filenames or directories to hide.
Motivation
This prevents the plugin from scanning "poisonous" symlinks that can cause the editor to hang and provides a clean workspace even in non-Git environments. It makes the file tree much more stable and user-friendly for complex home directories.
Proposed Implementation Details
-
Option Registration:
config.RegisterCommonOption('filemanager2', 'hideassets', true)
-
The Filter Logic:
local function get_custom_ignore()
local readout_results = {}
local config_dir = config.ConfigDir
local ignore_file_path = config_dir .. "/plug/filemanager2/.filemanager-ignore"
local go_os = import("os")
local _, err = go_os.Stat(ignore_file_path)
if err == nil then
local file = io.open(ignore_file_path, "r")
if file then
for line in file:lines() do
local pattern = line:match("^%s*(.-)%s*$")
if pattern ~= "" and string.sub(pattern, 1, 1) ~= "#" then
readout_results[#readout_results + 1] = pattern
end
end
file:close()
end
end
return readout_results
end
-
Integration:
Integrate get_custom_ignore() into the get_scanlist() function to filter results before they are processed.
I've already implemented this in my local version. Are you interested in a Pull Request for this feature?
Best regards,
Michael
Hi,
I'm using your
filemanager2plugin and I love the improvements. However, I encountered a challenge when working in directories with problematic symlinks (e.g., disconnected network mounts or broken docker registries) or in environments where I don't have a Git repository.Currently, the plugin relies on Git for ignoring files. In my setup, I implemented a surgical solution that adds a local ignore file support:
filemanager2.hideassets(true/false) to toggle custom filtering..filemanager-ignorefile located in the plugin directory where users can list filenames or directories to hide.Motivation
This prevents the plugin from scanning "poisonous" symlinks that can cause the editor to hang and provides a clean workspace even in non-Git environments. It makes the file tree much more stable and user-friendly for complex home directories.
Proposed Implementation Details
Option Registration:
The Filter Logic:
Integration:
Integrate
get_custom_ignore()into theget_scanlist()function to filter results before they are processed.I've already implemented this in my local version. Are you interested in a Pull Request for this feature?
Best regards,
Michael