mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
eval.c: has("unnamedplus"). (#6136)
Return 1 for UNIX with a functioning clipboard provider. Closes #6103
This commit is contained in:
parent
158ea52854
commit
b0bbe82a60
@ -11442,6 +11442,10 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
#endif
|
||||
} else if (STRICMP(name, "syntax_items") == 0) {
|
||||
n = syntax_present(curwin);
|
||||
#ifdef UNIX
|
||||
} else if (STRICMP(name, "unnamedplus") == 0) {
|
||||
n = eval_has_provider("clipboard");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
|
||||
local eq = helpers.eq
|
||||
local clear = helpers.clear
|
||||
local funcs = helpers.funcs
|
||||
local iswin = helpers.iswin
|
||||
|
||||
describe('has()', function()
|
||||
before_each(clear)
|
||||
@ -49,4 +50,11 @@ describe('has()', function()
|
||||
eq(1, funcs.has("nvim-00.001.05"))
|
||||
end)
|
||||
|
||||
it('"unnamedplus"', function()
|
||||
if (not iswin()) and funcs.has("clipboard") == 1 then
|
||||
eq(1, funcs.has("unnamedplus"))
|
||||
else
|
||||
eq(0, funcs.has("unnamedplus"))
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user