vim-projectionist icon indicating copy to clipboard operation
vim-projectionist copied to clipboard

Projectile detection doesn't include newly-started files

Open dbarnett opened this issue 11 years ago • 3 comments

I have a projectile for vim plugins: 'plugin/*.vim|autoload/**/*.vim|addon-info.json'. I also created a template for addon-info.json. The projectile matches any directory that contains an addon-info.json file, but if I create a new directory and run vim newdir/addon-info.json, the projectile doesn't match and the template isn't used.

Projectiles should be triggered when first starting to edit a file that matches the projectile pattern, even if the file hasn't been saved yet.

dbarnett avatar May 28 '14 02:05 dbarnett

"Should" is reaaaally presumptuous. You could maybe argue for this under a liberal interpretation of DWIM but I'm not sure I'm convinced.

tpope avatar May 28 '14 05:05 tpope

Yeah, I was going to say "probably should"…

Are there particular cases where you see this going wrong? As it is, the logic for templates is "Use when starting the second and subsequent files in a project." Possibly safer, but it's been causing a lot of bother for me and it's not clear to me that there's any actual downside to changing it.

dbarnett avatar Jun 07 '14 04:06 dbarnett

The proper event would be after writing the file, not after editing it, as that's when it actually becomes a valid project. But this event is tricky to tap into.

tpope avatar Jun 07 '14 21:06 tpope