Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable full path specifications for NERDTreeIgnore #1207

Merged
merged 6 commits into from
Jan 20, 2021
Merged

Conversation

PhilRunninger
Copy link
Member

@PhilRunninger PhilRunninger commented Jan 20, 2021

Description of Changes

Closes #1203

Added a new tag [[path]], for NERDTreeIgnore, that performs a pattern match on the full path of the node instead of just the last component of it. This is useful if you have a particular folder that you want to be hidden, while still showing every other instance of that folder. For example,

let NERDTreeIgnore = ['tmp/cache$[[path]]']`

will cause NERDTree to ignore /tmp/cache and /home/foo/projects/bar/tmp/cache, but /spooler/cache and /usr/bin/cache will be displayed.

The path regex needs to be compatible with the OS you're using, so for Windows, you would need to escape the backslashes, like so: 'tmp\\cache[[path]]' or 'C:\\Users\\foo\\tmp\\cache$[[path]]'.


New Version Info

Author's Instructions

  • Derive a new MAJOR.MINOR.PATCH version number. Increment the:
    • MAJOR version when you make incompatible API changes
    • MINOR version when you add functionality in a backwards-compatible manner
    • PATCH version when you make backwards-compatible bug fixes
  • Update CHANGELOG.md, following the established pattern.

Collaborator's Instructions

  • Review CHANGELOG.md, suggesting a different version number if necessary.
  • After merging, tag the commit using these (Mac-compatible) bash commands:
    git checkout master
    git pull
    sed -n "$(grep -n -m2 '####' CHANGELOG.md | cut -f1 -d: | sed 'N;s/\n/,/')p" CHANGELOG.md | sed '$d'
    git tag -a $(read -p "Tag Name: " tag;echo $tag) -m"$(git show --quiet --pretty=%s)";git push origin --tags

This ignore expression compares itself against the whole path of the
node, instead of just the tail component of the node.
Using the UI-formatted path had two problems.
1. It always appended a forward slash at the end of the path, which was
   unnecessary and made patterns like '/tmp/cache$[[path]]' not work as
   expected.
2. It always used forward slashes to join the path components. I thought
   this would be a good thing, but there's no reason to force Windows
   users to use that syntax. They'll just need to remember to escape the
   backslashes, like so: '\\Temp\\cache$[[path]]'
@PhilRunninger PhilRunninger merged commit b134f65 into master Jan 20, 2021
@PhilRunninger PhilRunninger deleted the i1203 branch January 20, 2021 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore subdirectories
1 participant