mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #32358 from zeertzjq/vim-8.2.0849
vim-patch:8.2.{0849,0931},9.1.1081
This commit is contained in:
commit
5371659524
1
runtime/doc/builtin.txt
generated
1
runtime/doc/builtin.txt
generated
@ -4597,6 +4597,7 @@ has({feature}) *has()*
|
|||||||
fname_case Case in file names matters (for Darwin and MS-Windows
|
fname_case Case in file names matters (for Darwin and MS-Windows
|
||||||
this is not present).
|
this is not present).
|
||||||
gui_running Nvim has a GUI.
|
gui_running Nvim has a GUI.
|
||||||
|
hurd GNU/Hurd system.
|
||||||
iconv Can use |iconv()| for conversion.
|
iconv Can use |iconv()| for conversion.
|
||||||
linux Linux system.
|
linux Linux system.
|
||||||
mac MacOS system.
|
mac MacOS system.
|
||||||
|
1
runtime/lua/vim/_meta/vimfn.lua
generated
1
runtime/lua/vim/_meta/vimfn.lua
generated
@ -4148,6 +4148,7 @@ function vim.fn.globpath(path, expr, nosuf, list, allinks) end
|
|||||||
--- fname_case Case in file names matters (for Darwin and MS-Windows
|
--- fname_case Case in file names matters (for Darwin and MS-Windows
|
||||||
--- this is not present).
|
--- this is not present).
|
||||||
--- gui_running Nvim has a GUI.
|
--- gui_running Nvim has a GUI.
|
||||||
|
--- hurd GNU/Hurd system.
|
||||||
--- iconv Can use |iconv()| for conversion.
|
--- iconv Can use |iconv()| for conversion.
|
||||||
--- linux Linux system.
|
--- linux Linux system.
|
||||||
--- mac MacOS system.
|
--- mac MacOS system.
|
||||||
|
@ -5119,6 +5119,7 @@ M.funcs = {
|
|||||||
fname_case Case in file names matters (for Darwin and MS-Windows
|
fname_case Case in file names matters (for Darwin and MS-Windows
|
||||||
this is not present).
|
this is not present).
|
||||||
gui_running Nvim has a GUI.
|
gui_running Nvim has a GUI.
|
||||||
|
hurd GNU/Hurd system.
|
||||||
iconv Can use |iconv()| for conversion.
|
iconv Can use |iconv()| for conversion.
|
||||||
linux Linux system.
|
linux Linux system.
|
||||||
mac MacOS system.
|
mac MacOS system.
|
||||||
|
@ -3075,9 +3075,12 @@ static void f_gettext(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
|||||||
static void f_has(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
static void f_has(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||||
{
|
{
|
||||||
static const char *const has_list[] = {
|
static const char *const has_list[] = {
|
||||||
#if defined(BSD) && !defined(__APPLE__)
|
#if defined(BSD) && !defined(__APPLE__) && !defined(__GNU__)
|
||||||
"bsd",
|
"bsd",
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __GNU__
|
||||||
|
"hurd",
|
||||||
|
#endif
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
"linux",
|
"linux",
|
||||||
#endif
|
#endif
|
||||||
|
@ -2655,36 +2655,6 @@ func Test_func_exists_on_reload()
|
|||||||
delfunc ExistingFunction
|
delfunc ExistingFunction
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_platform_name()
|
|
||||||
" The system matches at most only one name.
|
|
||||||
let names = ['amiga', 'beos', 'bsd', 'hpux', 'linux', 'mac', 'qnx', 'sun', 'vms', 'win32', 'win32unix']
|
|
||||||
call assert_inrange(0, 1, len(filter(copy(names), 'has(v:val)')))
|
|
||||||
|
|
||||||
" Is Unix?
|
|
||||||
call assert_equal(has('beos'), has('beos') && has('unix'))
|
|
||||||
call assert_equal(has('bsd'), has('bsd') && has('unix'))
|
|
||||||
call assert_equal(has('hpux'), has('hpux') && has('unix'))
|
|
||||||
call assert_equal(has('linux'), has('linux') && has('unix'))
|
|
||||||
call assert_equal(has('mac'), has('mac') && has('unix'))
|
|
||||||
call assert_equal(has('qnx'), has('qnx') && has('unix'))
|
|
||||||
call assert_equal(has('sun'), has('sun') && has('unix'))
|
|
||||||
call assert_equal(has('win32'), has('win32') && !has('unix'))
|
|
||||||
call assert_equal(has('win32unix'), has('win32unix') && has('unix'))
|
|
||||||
|
|
||||||
if has('unix') && executable('uname')
|
|
||||||
let uname = system('uname')
|
|
||||||
call assert_equal(uname =~? 'BeOS', has('beos'))
|
|
||||||
" GNU userland on BSD kernels (e.g., GNU/kFreeBSD) don't have BSD defined
|
|
||||||
call assert_equal(uname =~? '\%(GNU/k\w\+\)\@<!BSD\|DragonFly', has('bsd'))
|
|
||||||
call assert_equal(uname =~? 'HP-UX', has('hpux'))
|
|
||||||
call assert_equal(uname =~? 'Linux', has('linux'))
|
|
||||||
call assert_equal(uname =~? 'Darwin', has('mac'))
|
|
||||||
call assert_equal(uname =~? 'QNX', has('qnx'))
|
|
||||||
call assert_equal(uname =~? 'SunOS', has('sun'))
|
|
||||||
call assert_equal(uname =~? 'CYGWIN\|MSYS', has('win32unix'))
|
|
||||||
endif
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Test confirm({msg} [, {choices} [, {default} [, {type}]]])
|
" Test confirm({msg} [, {choices} [, {default} [, {type}]]])
|
||||||
func Test_confirm()
|
func Test_confirm()
|
||||||
CheckUnix
|
CheckUnix
|
||||||
@ -2739,6 +2709,36 @@ func Test_confirm()
|
|||||||
call assert_fails('call confirm("Are you sure?", "&Yes\n&No\n", 0, [])', 'E730:')
|
call assert_fails('call confirm("Are you sure?", "&Yes\n&No\n", 0, [])', 'E730:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_platform_name()
|
||||||
|
" The system matches at most only one name.
|
||||||
|
let names = ['amiga', 'bsd', 'hpux', 'linux', 'mac', 'qnx', 'sun', 'vms', 'win32', 'win32unix']
|
||||||
|
call assert_inrange(0, 1, len(filter(copy(names), 'has(v:val)')))
|
||||||
|
|
||||||
|
" Is Unix?
|
||||||
|
call assert_equal(has('bsd'), has('bsd') && has('unix'))
|
||||||
|
call assert_equal(has('hpux'), has('hpux') && has('unix'))
|
||||||
|
call assert_equal(has('hurd'), has('hurd') && has('unix'))
|
||||||
|
call assert_equal(has('linux'), has('linux') && has('unix'))
|
||||||
|
call assert_equal(has('mac'), has('mac') && has('unix'))
|
||||||
|
call assert_equal(has('qnx'), has('qnx') && has('unix'))
|
||||||
|
call assert_equal(has('sun'), has('sun') && has('unix'))
|
||||||
|
call assert_equal(has('win32'), has('win32') && !has('unix'))
|
||||||
|
call assert_equal(has('win32unix'), has('win32unix') && has('unix'))
|
||||||
|
|
||||||
|
if has('unix') && executable('uname')
|
||||||
|
let uname = system('uname')
|
||||||
|
" GNU userland on BSD kernels (e.g., GNU/kFreeBSD) don't have BSD defined
|
||||||
|
call assert_equal(uname =~? '\%(GNU/k\w\+\)\@<!BSD\|DragonFly', has('bsd'))
|
||||||
|
call assert_equal(uname =~? 'HP-UX', has('hpux'))
|
||||||
|
call assert_equal(uname =~? 'Linux', has('linux'))
|
||||||
|
call assert_equal(uname =~? 'Darwin', has('mac'))
|
||||||
|
call assert_equal(uname =~? 'QNX', has('qnx'))
|
||||||
|
call assert_equal(uname =~? 'SunOS', has('sun'))
|
||||||
|
call assert_equal(uname =~? 'CYGWIN\|MSYS', has('win32unix'))
|
||||||
|
call assert_equal(uname =~? 'GNU', has('hurd'))
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_readdir()
|
func Test_readdir()
|
||||||
call mkdir('Xdir')
|
call mkdir('Xdir')
|
||||||
call writefile([], 'Xdir/foo.txt')
|
call writefile([], 'Xdir/foo.txt')
|
||||||
|
Loading…
Reference in New Issue
Block a user