-
Notifications
You must be signed in to change notification settings - Fork 258
fix(file-nesting): ensure deterministic rule application #1602
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
Conversation
…rules (nvim-neo-tree#1494) When multiple file nesting rules were configured, rules were being applied inconsistently. For example, sometimes when both `package.json` and `vite.config.*` rules existed, only one set of rules would be applied while the other would be ignored intermittently. Example configuration that was working inconsistently: ```lua { ['vite.config.*'] = { files = { '%.babelrc*', 'babel%.config%.*', 'postcss%.config%.*', 'tailwind%.config%.*', '%.env%.*', 'tsconfig%.*' }, pattern = 'vite%.config%.(.*)$' }, ['package.json'] = { files = { '%.browserslist*', 'bower%.json', 'package-lock%.json', 'yarn%.lock', '%.eslint*', '%.prettier*' }, pattern = 'package%.json$' } } ``` The fix modifies the nesting logic to: - Collect all matching rules before applying any nesting - Use file IDs to prevent duplicate nesting - Track nested status properly - Apply rules in a deterministic order This ensures that all configured nesting rules are applied consistently regardless of their order or complexity. Fixes nvim-neo-tree#1494
It sounds like a good solution, but I'm afraid I don't have the time to properly evaluate it. See #1606. |
Made the rule application actually deterministic. Rules now have an optional lmk if you could try it out and make sure it works and i'll merge. |
When multiple file nesting rules were configured, rules were being applied inconsistently. For example, sometimes when both
package.json
andvite.config.*
rules existed, only one set of rules would be applied while the other would be ignored intermittently.Example configuration that was working inconsistently:
The fix modifies the nesting logic to:
This ensures that all configured nesting rules are applied consistently regardless of their order or complexity.
Fixes #1494