Mikolaj Machowski wrote:
Hello,
Results of findfile() are inconsistent:
/home/mikolaj/a
/home/mikolaj/1/b
/home/mikolaj/2/c
/home/mikolaj/3/d
/home/mikolaj/3/4/e
1. We are in /home/mikolaj::
echo findifile("b", "1;")
1/b
2. We are in /home/mikolaj/2::
echo findifile("b", "/home/mikolaj/1;")
/home/mikolaj/1/b
3. We are in /home/mikolaj/3/4::
echo findifile("d", "/home/mikolaj/3/4;")
/home/mikolaj/3/d
Why this inconsistence?
Also mention of ; as obligatory element would be good addition to docs.
m.
I don't see any inconsistency. According to the help, findfile() is
"Just like |finddir()|, but find a file instead of a directory." and
finddir() has: "When the found directory is below the current directory
a relative path is returned. Otherwise a full path is returned." Isn't
that what you got?
Is the semicolon really obligatory?
:lcd $VIMRUNTIME/doc
:echo findfile("help.txt",".")
(without a colon), returns "help.txt", which is the expected result.