b877fc65d8
Pull request #710 also brought to my attention some glaring code duplication in the TreeDirNode class. This commit renames and expands the glob method defined in PR #710 into a more general purpose helper method. The new method also ensures that 'wildignore' rules are applied consistently. Issue #569 noted that the application of the 'wildignore' setting in populating a node's children was unpredictable. When a node was rendered, "_initChildren()" would load the children with its own call to "globpath()". Refreshing the same node would then invoke "globpath()" again, but with different arguments. The result was that a node's children were initialized using the 'g:NERDTreeRespectWildIgnore' setting, but refreshing ignored this setting. So, if it the setting was 0, "test.class" might render when the parent was initialized, and then be removed on refresh (if 'wildignore' contained '*.class'). This commit solves this problem by ensuring that the NERDTree setting mentioned above is only checked and applied to a node's children in one place by cleaning up the duplication. Fixes #569.