tpope / vim-projectionist

projectionist.vim: Granular project configuration
https://www.vim.org/scripts/script.php?script_id=4989
1.06k stars 67 forks source link

Ignore VimEnter autocommand when starting with a session #186

Closed dradtke closed 10 months ago

dradtke commented 10 months ago

This is my proposed fix for https://github.com/tpope/vim-projectionist/issues/185.

The solution here is to simply ignore the VimEnter autocommand when started with a session file, since starting with an existing session is functionally equivalent to having started with a specific file to edit (when argc() > 0).

A possible alternative solution would be to listen for the SessionLoadPost autocommand and do something like set g:projectionist_vim_enter = 0, but this solution is shorter and more straightforward.