forked from aniani/vim
patch 8.2.4082: check for autoload file name and prefix fails
Problem: Check for autoload file name and prefix fails. (Christian J. Robinson) Solution: Only lower case the prefix on systems where the file name is not case sensitive.
This commit is contained in:
@@ -2156,7 +2156,11 @@ get_autoload_prefix(scriptitem_T *si)
|
||||
|
||||
if (p == NULL)
|
||||
return NULL;
|
||||
#ifdef CASE_INSENSITIVE_FILENAME
|
||||
prefix = strlow_save(p);
|
||||
#else
|
||||
prefix = vim_strsave(p);
|
||||
#endif
|
||||
if (prefix == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@@ -1375,6 +1375,31 @@ def Test_vim9_aucmd_autoload()
|
||||
&rtp = save_rtp
|
||||
enddef
|
||||
|
||||
" test using a autoloaded file that is case sensitive
|
||||
def Test_vim9_autoload_case_sensitive()
|
||||
var lines =<< trim END
|
||||
vim9script autoload
|
||||
export def CaseSensitive(): string
|
||||
return 'done'
|
||||
enddef
|
||||
END
|
||||
|
||||
mkdir('Xdir/autoload', 'p')
|
||||
writefile(lines, 'Xdir/autoload/CaseSensitive.vim')
|
||||
var save_rtp = &rtp
|
||||
exe 'set rtp^=' .. getcwd() .. '/Xdir'
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
import autoload 'CaseSensitive.vim'
|
||||
assert_equal('done', CaseSensitive.CaseSensitive())
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
|
||||
delete('Xdir', 'rf')
|
||||
&rtp = save_rtp
|
||||
enddef
|
||||
|
||||
" This was causing a crash because suppress_errthrow wasn't reset.
|
||||
def Test_vim9_autoload_error()
|
||||
var lines =<< trim END
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
4082,
|
||||
/**/
|
||||
4081,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user