On 04/06/2019 19:18, Bram Moolenaar wrote:
>
> Mike Williams wrote:
>
>> It looks like the change to Windows for resolve() in 8.1.1417 was a
>> breaking change. I use the NERDtree plugin and any build after than
>> change results in NERDtree reports plain files on Windows as links. See
>> attached image.
>>
>> I guess the question is. is this wrong in VIM or a bad assumption in
>> NERDtree in what resolve() returns? Since it is a breaking change in
>> VIM I thought I would start the ball rolling here.
>
> Perhaps NERDtree checks if the returned path is a full path?
> Assuming you still have the older Vim version, compare the output of
> resolve() for some simple files, is it different?
It is different. 8.1.1416 does not return a full path for simple files
while 8.1.1417 onwards does.
> The docs say:
> On MS-Windows, when {filename} is a shortcut (a .lnk file),
> returns the path the shortcut points to in a simplified form.
> When {filename} is a symbolic link or junction point, return
> the full path to the target. If the target of junction is
> removed, return {filename}.
>
> It says some more about a simplified result. But that wasn't changed.
Based on the above it means that there is no way to tell the difference
between a simple file and a symbolic link or junction point, getftype()
does not help on Windows. But perhaps that does not matter.
Spelunking in NERDtree the root cause of the problem is directory
separators. It seems a bit free in always using '/' when building
paths. Now that resolve() returns a full path filepath checks based on
string comparison fails. A local hack^wfix confirms this but NERDtree
is still able to detect symbolic links so there must some other method
to distinguish that I am not aware of.
I'll bounce over to GitHub to report this.
TTFN
Mike
--
Never use a long word when a diminutive one will do.