[email protected] wrote:
> It seems that if lcd is used, the paths in the session files are not
> set correctly anymore.
> I use 7.2.108 (gentoo-linux) and have not had this behaviour in 7.2.
>
> Try this to reproduce:
>
> * rm ~/.viminfo ~/.vimrc
> * vim --noplugin
> * :ed ~/subfolder/test.txt
> * :lcd ~/subfolder/.
> * :mks! ~/sess-test.vim
> * :qa
> * vim --noplugin -S sess-test.vim
>
> Result: vim does not open ~/subfolder/test.txt but test.txt (which
> does not exist).
> This does not happen if lcd (see above) is not called.
It looks like this bug was introduced with 7.2.055.
The attached patch against 7.2.127 seems to fix this.
I wanted to CC vim-dev, but my email does not seem to come through, so I'll post
on vim-dev separately.
--
Andreas.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
Problem: Saving a session file ignores changes in the cwd of a buffer.
Solution: Check for correct return code of mch_chdir.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 60bbb5f..c730d76 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8792,7 +8792,7 @@ ex_mkrc(eap)
else if (*dirnow != NUL
&& (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
{
- if (mch_chdir((char *)globaldir) == OK)
+ if (mch_chdir((char *)globaldir) == 0)
shorten_fnames(TRUE);
}