From f3bf1fbf600050fde155e6a1a766b6f848012208 Mon Sep 17 00:00:00 2001 From: ii14 <59243201+ii14@users.noreply.github.com> Date: Mon, 5 Dec 2022 19:59:04 +0100 Subject: 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 --- test/functional/lua/secure_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/functional/lua') 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) -- cgit