Thursday, June 24, 2010

findfile() behaviour difference to finddir() - no path information


VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jun 22 2010 14:52:33)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-444

When I issue a finddir(), I get an absolute path back to the location of my file (in my particular case).

When I issue a findfile(), I get just the file, which is kind of useless since I want to edit the file.  This only tells me it found it, not where it found it.

Looking at :h finddir()

        Returns the path of the first found match.  When the found
        directory is below the current directory a relative path is
        returned.  Otherwise a full path is returned.


:h findfile()
        Just like |finddir()|, but find a file instead of a directory.

So I should be receiving either a relative path name or a fullpath.  Given the finddir() returned the fullpath in this case, findfile() should also.
In my case, I received just the filename even though the file was several directories deep from the initial path to search from.  finddir() did the "right thing".


Could someone verify the intended behaviour?

TIA,
Dave





No comments:

Post a Comment