mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 11:38:31 +00:00
fix(ex_cmds): correct flags for :const (#19387)
This commit is contained in:
@@ -631,7 +631,7 @@ module.cmds = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='const',
|
command='const',
|
||||||
flags=bit.bor(NEEDARG, EXTRA, NOTRLCOM, CMDWIN),
|
flags=bit.bor(EXTRA, NOTRLCOM, SBOXOK, CMDWIN),
|
||||||
addr_type='ADDR_NONE',
|
addr_type='ADDR_NONE',
|
||||||
func='ex_const',
|
func='ex_const',
|
||||||
},
|
},
|
||||||
|
@@ -5,6 +5,7 @@ local clear = helpers.clear
|
|||||||
local command = helpers.command
|
local command = helpers.command
|
||||||
local eval = helpers.eval
|
local eval = helpers.eval
|
||||||
local meths = helpers.meths
|
local meths = helpers.meths
|
||||||
|
local exec = helpers.exec
|
||||||
local exec_capture = helpers.exec_capture
|
local exec_capture = helpers.exec_capture
|
||||||
local source = helpers.source
|
local source = helpers.source
|
||||||
local testprg = helpers.testprg
|
local testprg = helpers.testprg
|
||||||
@@ -91,3 +92,19 @@ describe(':let', function()
|
|||||||
eq(1, eval('1'))
|
eq(1, eval('1'))
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
describe(':let and :const', function()
|
||||||
|
it('have the same output when called without arguments', function()
|
||||||
|
eq(exec_capture('let'), exec_capture('const'))
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('can be used in sandbox', function()
|
||||||
|
exec([[
|
||||||
|
func Func()
|
||||||
|
let l:foo = 'foo'
|
||||||
|
const l:bar = 'bar'
|
||||||
|
endfunc
|
||||||
|
sandbox call Func()
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
Reference in New Issue
Block a user