On Thu, Mar 5, 2009 at 11:07 AM, Bram Moolenaar <[email protected]> wrote:
> Cycles in symbolic links are rare. The code should be able to handle
> this, in a way that it doesn't drop all results that contain a symbolic
> link. Thus symbolic links should be followed, unless getting to a
> directory that was previously visited.
My initial plan was to do that but I dropped it since I thought that it
might incur more processing. Seems like hash_* in hashtab.c might help
here.
> Anyway, the patch adds a lot of code. I'm wondering if we can reuse
> more of the existing code. How about using globpath()? Or use
> find_file_in_path(), like ex_find() does (also accepting directories
> though). The last one also takes care of removing duplicates.
>
> If your code is to be used, the chdir() calls are not safe. Look at the
> mch_FullName() function in os_unix.c, lots of remarks about this.
> Yet another reason to use as much of the existing code, that has been
> debugged for a long time, instead of introducing new code which new
> problems.
I agree with all of the above. Thanks for the hints and comments.
> Also, the functions potentially take a lot of time, so they should check
> for CTRL-C now and then. That means calling ui_breakcheck() and
> checking the got_int flag.
Currently it checks only for the got_int flag. I'll include
ui_breakcheck too, later.
There's a couple more issues that I found out while using :find with the
patch:
1. It doesn't honor the 'wildignore' setting in cases where there
are more than one files matching the pattern and at least one of
them would be excluded by 'wildignore'. The current behavior is
that it will list all the files that match the pattern whether or
not it matches 'wildignore'.
2. Doing :find a/*/hello.html gets uniquefied to hello.html, which
may not be what we want as there might be other hello.html in
'path'. The solution to this might be to uniquefy the name based
on the pattern, not by the fullpath alone.
I'll look into this when I got another wave of free time.
nazri
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---