Felix Kater wrote:

> Bram Moolenaar wrote:
> 
> > What is the session file that opens subfodler/test.txt?  Best is if you
> > can give the commands to create it, thus a whole reproducible example.
> 
> The example is the same like in my original posting, however with
> this .vimrc (I copied it long ago from vim.org):
> 
> --- (BEGIN .vimrc) ---
> function AlwaysCD()
>       if bufname("") !~ "^ftp://";
>               lcd %:p:h
>       endif
> endfunction
> autocmd BufEnter * call AlwaysCD()
> --- (END) ---
> 
> To reproduce (full description):
> 
> * cd ~
> * create a .vimrc like above
> * mkdir subfolder
> 
> * rm .viminfo
> * mv .vim .vim.bak
> * vim --noplugin subfolder/test.txt
> * :w
> * :mks! ~/sess-test.vim
> * :qa
> * vim --noplugin -S sess-test.vim
> 
> Resulting error message:
> 
> --- (START) ---
> "subfolder/test.txt" [New DIRECTORY]
> Error detected while processing function AlwaysCD:
> line    2:
> E344: Can't find directory "subfolder" in cdpath
> E472: Command failed
> Press ENTER or type command to continue
> --- (END) ---
> 
> A sidenote: The created session file contains the line "badd +0
> subfolder/test.txt",
> however, I believe in earlier versions of vim it always was like "badd
> +0 ~/subfolder/test.txt".
> I neither know if I rememer right nor if that is related to the above
> issue.

Thanks for the explantion.  I don't get the error message, but the file
is edited in the wrong directory.  The session file contains:

        cd ~/
        badd +0 hello.html
        args hello.html
        edit hello.html
        ...
        lcd ~/tmp

Thus it's in the right directory, but editing the file in ~/ instead of
~/tmp.

-- 
hundred-and-one symptoms of being an internet addict:
163. You go outside for the fresh air (at -30 degrees) but open the
     window first to hear new mail arrive.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to