The problem with an autocommand like this is that it can perform any Vim
command. Callers of vim_chdir() are most likely not prepared for that
and may use invalid pointers, causing Vim to crash.
There is no generic way to solve this. It requires thinking of all the
nasty things that the autocommand might do and checking that all of them
are handled correctly in all places from where the autocommand can be
triggered. That's tough.
--
"Time flies like an arrow". So I put an arrow on my desk, now
awaiting one of these time flies showing up.
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
I'm not sure how it's possible to reliably implement this feature
given that I can easily chdir with Vim being unaware , for example:
:ruby Dir.chdir '..'
--
Kent