Mikalai Chaly wrote:

> Hello! I'm forwarding this message from vim_use - could you specify if
> it is a "set encoding" bug or not:
> 
> On Sat, Oct 3, 2009 at 6:33 PM, Maxim Kim <[email protected]> wrote:
> >
> > Hi,
> >
> > Could anyone verify the next behaviour:
> >
> >    1. _vimrc should only have:
> >       set nocp
> >       set autochdir
> >       set encoding=utf-8
> >    2. in the shell do:
> >       mkdir test
> >       echo hello world > test\myfile
> >       vim test\myfile
> >
> > My vim do not open test\myfile it just says: "test\myfile" [New
> > DIRECTORY]
> >
> > Now if you delete 'set endoding=utf-8' from your _vimrc so you would
> > have only:
> > set nocp
> > set autochdir
> >
> > and run:
> >   vim test\myfile
> > Vim opens this file successfully.
> >
> > Okay, now if I delete 'set autochdir' and return 'set encoding=utf-8'
> > like this:
> > set nocp
> > set encoding=utf-8
> >
> > and run again:
> >   vim test\myfile
> > Vim opens this file successfully too.
> >
> > It looks like with the combination of 'set autochdir' and 'set
> > encoding=utf-8' one can not open files in another dir from shell.
> >
> > So I use autocmd approach now:
> >    autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ /
> > instead of autochdir.
> >
> >
> > My vim is 7.2 with 1-148 patches applied on winXP.
> >
> > Best wishes,
> >    Maxim.
> >
> > >
> >
> 
> "set encoding" brings up multibyte initialization, which re-writes
> parameters for buffer using new encoding. During this process, file
> name is changed from correct "myfile" to the original "test\myfile"
> and expanded to "test\test\myfile". That breaks result or 'autochdir'
> processing.
> 
> Such vimrc:
> 
> set nocp
> set encoding=utf-8
> set autochdir
> 
> opens required file correctly.
> 
> Is this a bug or just "autochdir"-specific behavour?

I already added an item to the todo list to look into this:

Win32: When 'autochdir' is on and 'encoding' is changed, files on the command
line are opened again, but from the wrong directory.  Apply 'autochdir' only
after starting up?

It doesn't have a high priority...


-- 
GUARD #2:  Wait a minute -- supposing two swallows carried it together?
GUARD #1:  No, they'd have to have it on a line.
GUARD #2:  Well, simple!  They'd just use a standard creeper!
GUARD #1:  What, held under the dorsal guiding feathers?
GUARD #2:  Well, why not?
                                  The Quest for the Holy Grail (Monty Python)

 /// 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_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui