Sunday, June 8, 2014

Re: Apparent bug with file upward-search on Windows

On 08/06/14 21:16, Brett Stahlman wrote:
> Hello,
> I've read the section on upward search (:help file-searching), and believe I
> understand how it's supposed to work. The example in the help works the way I
> expect on Linux, but not on Windows.
>
> Specifically, I created the following set of files and directories to match
> the example from the help:
>
> C:/Users/stahlmanb/tmp/u/user_x/work/release/test.c
> C:/Users/stahlmanb/tmp/u/user_x/include/test.h
>
> Note: To make things work on Windows, I've simply replaced Linux `/' with the
> following Windows path: C:/Users/stahlmanb/tmp/
>
> Then, within Vim...
> cd C:/Users/stahlmanb/tmp/u/user_x/work/release
> e test.c
> set path=include;C:/Users/stahlmanb/tmp/u/user_x
>
> Hitting gf with the cursor positioned on test.h (inside test.c) produces...
> E447: Can't find file "test.h" in path
>
> I recreated the same test on Linux, replacing...
> C:/Users/stahlmanb/tmp/
> ...with...
> /home/stahlman/tmp/
> ...and everything worked as expected: test.h was found in the
> /home/stahlman/tmp/u/user_x/include directory.
>
> Is there something I've missed that could explain the discrepancy, or is this
> a bug?
>
> Thanks,
> Brett Stahlman
>

In the 'path' option, a single dot means "the same directory as the
file" and an empty item (two commas after each other) mean the current
directory. Both are included in the default value. Also, that option is
a _comma_-separated list, not a _semicolon_-separated list. See the
example at the very end of the ":help 'path'" section, immediately
before ":help 'preserveindent'".


Berst regards,
Tony.
--
There once was a fellow named Sweeney
Who spilled gin all over his weenie.
Not being uncouth,
He added vermouth
And slipped his amour a martini.

--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: