vim-maktaba icon indicating copy to clipboard operation
vim-maktaba copied to clipboard

maktaba#path#GetDirectory behavior needs more thought

Open dbarnett opened this issue 12 years ago • 0 comments

maktaba#path#GetDirectory treats nonexistent paths as directories:

echo maktaba#path#GetDirectory('foo/bar/NONEXISTENT')
" --> foo/bar/NONEXISTENT/

Originally we had a variant that assumed files, not directories, but that was deleted. I would argue that assuming files in ambiguous cases is the more intuitive behavior, and we should detect trailing slashes so there's a mechanism to get the alternative behavior in cases where the caller already believes the nonexistent path should refer to a directory.

dbarnett avatar Dec 19 '13 17:12 dbarnett