vim-dirvish-git icon indicating copy to clipboard operation
vim-dirvish-git copied to clipboard

Fix folders that include ignored files

Open JoosepAlviste opened this issue 5 years ago • 0 comments

Hey! I've another pull request if you're not too busy.

If a folder includes a file that has been ignored, then it would almost always be shown as "ignored", even if the folder also contains files that have NOT been ignored.

An example file structure:

.
├── .gitignore
└── folder
    ├── ignored.txt
    └── not_ignored.txt

Where the .gitignore file includes the following:

folder/ignored.txt

This causes the whole folder/ entry to be marked as "ignored" even though not_ignored.txt is not ignored. This doesn't seem to make sense to me and I think that a folder should be marked as "ignored" only if all of the files inside it are ignored.

One thing I'm not too sure about is running expand('%') in every loop iteration -- I'm not sure if it has any performance impact.


Visual example:

Without my patch:

Screenshot 2020-05-29 at 16 33 41

With my patch:

Screenshot 2020-05-29 at 16 34 50

JoosepAlviste avatar May 29 '20 13:05 JoosepAlviste