Skip to content

Use glob expressions to filter files and folders - #3335

Closed
Neway13 wants to merge 1 commit into
marktext:developfrom
Neway13:exclude_files_or_folders
Closed

Neway13 wants to merge 1 commit into
marktext:developfrom
Neway13:exclude_files_or_folders

Conversation

@Neway13

@Neway13 Neway13 commented Jul 2, 2022 •

Copy link
Copy Markdown
Q A
Bug fix? no
New feature? yes
Breaking changes? no
Deprecations? no
New tests added? not needed
Fixed tickets none
License MIT

Description

I added a feature to filter files and folders.

Sometimes we don't want certain files or folders displayed in the sidebar. It would look cleaner if we excluded them from the tree, such as the Image assets folders.

So I developed this feature. By configuring the glob patterns, users can exclude files or folders that they do not want to display. Use "," to separate multiple pattern.

Suppose my directory structure is as follows:
expolre

The following three expressions are configured:

  1. **/*t/temp to exclude the file or folder named temp in base folder
  2. **/*temp.md to exclude all files or folders whose names end with temp.md
  3. **/*.assets to exclude all files or folders whose names end with .assets

Use "," to separate multiple pattern: **/*t/temp,**/*temp.md,**/*.assets

config

Finally we will see the following structure in the sidebar:

tree

The minimatch module is used to parse glob patterns.

@Neway13
Neway13 marked this pull request as ready for review July 2, 2022 12:04
@Jocs

Jocs commented May 15, 2026

Copy link
Copy Markdown
Member

This project recently merged a large refactor (electron-vite migration, PR #4001) that upgraded dependencies and fixed several issues.

Please review this PR and let us know if it is still needed, or if the changes have already been addressed upstream.

Note: This PR currently has merge conflicts with the develop branch. If you decide to continue with this PR, please rebase or merge the latest develop branch to resolve the conflicts before it can be reviewed.

@Jocs

Jocs commented May 20, 2026

Copy link
Copy Markdown
Member

Hi @Neway13, thanks for opening this PR. We're going through old PRs and would like to confirm whether this one is still needed.

This PR has no description, and since it was opened the project has gone through an electron-vite refactor (#4001). src/common/filesystem/paths.js already has exclude-pattern infrastructure today.

Could you:

  1. Briefly describe what glob features your PR adds beyond the current exclude-pattern behavior, and
  2. If still relevant, rebase against the latest develop branch?

If you no longer have the time to push this forward, we'll close it after a few weeks. Thank you either way.

@Jocs Jocs added the 🐤 blocked/need info Need more details about this issue or pull request label May 20, 2026
@Neway13

Neway13 commented May 21, 2026

Copy link
Copy Markdown
Author

Hi @Jocs , it's great to see your reply. However, this pull request has been open for too long, and I've almost forgotten some of the details. I don't have time to handle it recently, so perhaps it would be better to close it. Thank you for the work you've done.

@Neway13 Neway13 closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐤 blocked/need info Need more details about this issue or pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants