lalitmetkar / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

:vimgrep with 'autochdir' set causes second match to be mis-located in CWD. #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

$ cd /tmp
$ vim -N -u NONE
:set autochdir
:vimgrep Bram $VIMRUNTIME/f*.vim
:clist
 1 filetype.vim:3 col 15: " Maintainer:   Bram Moolenaar <Bram@vim.org>
 2 /tmp/ftoff.vim:3 col 15: " Maintainer:   Bram Moolenaar <Bram@vim.org>
 3 ftplugin.vim:3 col 15: " Maintainer:   Bram Moolenaar <Bram@vim.org>
 4 ftplugof.vim:3 col 15: " Maintainer:   Bram Moolenaar <Bram@vim.org>
:echo expand('%:p')
/usr/local/share/vim/vim73/filetype.vim
:cnext
" An empty buffer opens, not the expected file
:echo expand('%:p')
/tmp/ftoff.vim

What is the expected output?

:clist
 1 filetype.vim:3 col 15: " Maintainer:   Bram Moolenaar <Bram@vim.org>
 2 ftoff.vim:3 col 15: " Maintainer:   Bram Moolenaar <Bram@vim.org>
 3 ftplugin.vim:3 col 15: " Maintainer:   Bram Moolenaar <Bram@vim.org>
 4 ftplugof.vim:3 col 15: " Maintainer:   Bram Moolenaar <Bram@vim.org>
:echo expand('%:p')
/usr/local/share/vim/vim73/filetype.vim
:cnext
" The match in the second file opens.
:echo expand('%:p')
/usr/local/share/vim/vim73/ftoff.vim

What version of the product are you using? On what operating system?

Reproducible both on the latest Vim 7.3.574 on Ubuntu Linux/x86, and with the 
default Vim 7.3 on Windows/x86 and Windows/x64. 'autochdir' must be set for the 
bug to appear.

:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 29 2012 15:17:21)
Included patches: 1-574
Compiled by Ingo Karkat <ingo@karkat.de>
Big version with GTK2 GUI.  Features included (+) or not (-):

:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 16 2010 10:31:31)
MS-Windows 64-bit GUI version with OLE support
Compiled by george@reilly.org
Huge version with GUI.  Features included (+) or not (-):

Please provide any additional information below.

I found this while testing my patch 7.3.570.

-- Ingo Karkat

Original issue reported on code.google.com by sw...@ingo-karkat.de on 29 Jun 2012 at 2:08

GoogleCodeExporter commented 9 years ago
Attached patch fixes the issue, by making sure shorten_fname1 is always called 
from the starting directory.

Original comment by chrisbr...@googlemail.com on 15 Aug 2012 at 9:07

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by chrisbr...@googlemail.com on 9 Jan 2015 at 12:14