Nazri Ramliy wrote:
> On Wed, Aug 4, 2010 at 4:39 AM, Bram Moolenaar <[email protected]> wrote:
> >> Attached is the fix on top of Revision: 7d1044b27e.
> >
> > Thanks and sorry, I suppose I caused this problem.
>
> That is minuscule compared to all the problems that I have caused with
> all this find-completion stuff :)
>
> Prove (this will show that I'm still naive at grokking vim source code):
>
> We shouldn't have to write window-specific code for the find completion
> because apparently f_globpath() works fine on both unix and windows and
> it happily uses globpath() to do its job.
>
> To cut a long story short, I found this out while writing a test script
> for testing the find completion stuff.
>
> With that realization I'm going to investigate why is it that on
> windows, globpath() as used in the expand_in_path() function fails to do
> its jobs when it works just fine when used in f_globpath(), with the
> exact same set of arguments.
>
> I'm attaching a patch to produce my "debug" version of eval.c and
> misc1.c which will show this problem for those who would like to help in
> investigating this.
>
> On windows, doing
>
> :echo globpath("c:/src/vim/**", "misc*")
>
> calls f_globpath(), which in turn calls globpath() with the arguments
> "c:/src/vim/**", "misc*" and 0 for path, file and expand_options,
> respectively and it successfully gives
>
> c:\src\vim\src\misc1.c
> c:\src\vim\src\misc2.c
> c:\src\vim\src\proto\misc1.c
> c:\src\vim\src\proto\misc2.c
> c:\src\vim\src\ObjC\misc1.obj
> c:\src\vim\src\ObjC\misc2.obj
> c:\src\vim\src\ObjG\misc1.obj
> c:\src\vim\src\ObjG\misc2.obj
>
> while doing
>
> :set path=c:/src/vim/**
> :find misc<tab>
>
> which call expand_in_path(), which in turns call globpath(), fails with
> the exact same argument "c:/src/vim/**", "misc*" and 0 for path, file and
> expand_options, respectively.
If the arguments are the same the returned values should be the same.
You will need to use a debugger to find out what really happens.
I noticed another problem: with 'path' set to "./**" and in an empty
buffer :find completion crashes. I fixed it.
Maybe I'll have time to look at the completion code, looks like you are
getting lost.
--
The process for understanding customers primarily involves sitting around with
other marketing people and talking about what you would to if you were dumb
enough to be a customer.
(Scott Adams - The Dilbert principle)
/// 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.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php