Nazri Ramliy wrote:

> >> On Tue, Jul 20, 2010 at 8:06 AM, Nazri Ramliy <[email protected]> wrote:
> >> Attached patch solves the duplicate entry.
> >>
> >> While fixing this bug I found another:
> 
> [snipped description of bug due to ...]
> 
> >> The function uniquefy_paths in misc1.c shortens the list of full path
> >> file names without taking into account the values in 'path' option.
> >>
> >> I'll look into fixing this too.
> >
> > Thanks, this works better.  I included this patch and made a few
> > cosmetical changes.
> >
> > I also see duplicates in the form "./term.h" and "term.h".  The "./" has
> > no effect, thus these two names are the same.  The complete list is:
> >
> >        ./term.h        include/term.h  term.h
> 
> Attached are four patches that fix the above problem and refine the behavior 
> of
> the find/sfind/tabfind completion. Also I've added note to the documentation 
> on
> the limitation of the completion when 'path' has url and directory limiter
> (/usr/**2) and upward search (;) notations.
> 
> Note that with this patch, the previous (duplicate) completions (done
> in vim's src
> directory with default 'path' setting):
> 
> >        ./term.h        include/term.h  term.h
> 
> are now "reduced" to:
> 
>       term.h
> 
> and it does not differentiate between "include/term.h" and "./term.h"
> due to because doing ":find include/term.h" would fail with the
> default 'path' setting (".,/usr/include,,").

Oh, I actually liked having both "term.h" and "include/term.h".
It's very difficult to get to the second one otherwise.

If the price to pay is to also have "./term.h" then so be it.  But
perhaps it can be more clever to recognize that "./term.h" and "term.h"
are actually the same.  I suppose the latter needs to be removed then.

":find include/term.h" doesn't work though.  I would think ":find
../include/term.h" works, but it doesn't.  Keeping the full path is
another solution.

Perhaps the algorithm can remove the path when there is only one choice,
but keep a longer path otherwise.  This also depends on the first entry
in 'path'.  Usually it's ".", thus if "./{shortened-match}" exists and
is different from the long name then it can't be shortened.

-- 
BEDEVERE: Look!  It's the old man from scene 24 - what's he Doing here?
ARTHUR:   He is the keeper of the Bridge.  He asks each traveler five
          questions ...
GALAHAD:  Three questions.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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

Raspunde prin e-mail lui