A change dir command has been made before BufWritePost..

How to make expand('%:p') of a file not impacted by a :cd change dir 
command ?



Le vendredi 21 février 2020 09:46:47 UTC+1, Ni Va a écrit :
>
> Hi,
>
> Using gvim 8.2.292 on windows, following error appears while I am saving a 
> vim file.
> It seems to mistake good drive. C: out of  D:
>
> *expand('%:p') returns bad drive.*
>
> Error detected while processing BufWritePost Autocommands for "*.vim":
>> E484: Can't open file c:
>> \logiciels\Vim\vimfiles\plugged\foo-bar\autoload\foobar.vim
>
>
>
>  autocmd! BufWritePost  *.vim    exe 'source '.expand('%:p')
>
>
>
>
>
>

-- 
-- 
You received this message from the "vim_use" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/8b365698-7fcd-46ab-8a8a-9bd090fe73df%40googlegroups.com.

Reply via email to