aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/secure_spec.lua
diff options
context:
space:
mode:
authorii14 <59243201+ii14@users.noreply.github.com>2022-12-05 19:59:04 +0100
committerGitHub <noreply@github.com>2022-12-05 11:59:04 -0700
commitf3bf1fbf600050fde155e6a1a766b6f848012208 (patch)
tree4de99c04bf7d666ac15707e418468640c0946b1a /test/functional/lua/secure_spec.lua
parent707df880545703bc6f4db1af6e46820becbcd911 (diff)
downloadrneovim-f3bf1fbf600050fde155e6a1a766b6f848012208.tar.gz
rneovim-f3bf1fbf600050fde155e6a1a766b6f848012208.tar.bz2
rneovim-f3bf1fbf600050fde155e6a1a766b6f848012208.zip
fix(secure): crash when hitting escape in prompt (#21283)
- use pcall when calling vim.secure.read from C - catch keyboard interrupts in vim.secure.read, rethrow other errors - selecting "view" in prompt runs :view command - simplify lua stack cleanup with lua_gettop and lua_settop Co-authored-by: ii14 <ii14@users.noreply.github.com>
Diffstat (limited to 'test/functional/lua/secure_spec.lua')
-rw-r--r--test/functional/lua/secure_spec.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/functional/lua/secure_spec.lua b/test/functional/lua/secure_spec.lua
index 6885253998..2647b2be46 100644
--- a/test/functional/lua/secure_spec.lua
+++ b/test/functional/lua/secure_spec.lua
@@ -150,10 +150,10 @@ describe('vim.secure', function()
]]}
feed('v')
screen:expect{grid=[[
- ^ let g:foobar = 42 |
+ ^let g:foobar = 42 |
{1:~ }|
{1:~ }|
- {2:]] .. cwd .. pathsep .. [[Xfile [RO]{MATCH:%s+}|
+ {2:]] .. funcs.fnamemodify(cwd, ':~') .. pathsep .. [[Xfile [RO]{MATCH:%s+}|
|
{1:~ }|
{4:[No Name] }|
@@ -166,7 +166,7 @@ describe('vim.secure', function()
-- Cannot write file
pcall_err(command, 'write')
- eq(false, curbufmeths.get_option('modifiable'))
+ eq(true, curbufmeths.get_option('readonly'))
end)
end)