Rich Healey wrote:

> I attempted to add a new hook to the autocmd subsystem to allow me to bind
> actions to the current working directory changing.
> 
> Attached is my attempt, I also tried patching ex_cd in desperation while it
> wasn't working. I think my issue is in the way I'm invoking
> apply_autocmds, but this seems to be the right approach. I would
> appreciate pointers in the right direction.

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 -- [email protected] -- 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    ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui