mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
feat(lua): enable stack traces in error output (#16228)
This commit is contained in:
@@ -494,6 +494,8 @@ describe('TUI', function()
|
||||
it('paste: recovers from vim.paste() failure', function()
|
||||
child_session:request('nvim_exec_lua', [[
|
||||
_G.save_paste_fn = vim.paste
|
||||
-- Stack traces for this test are non-deterministic, so disable them
|
||||
_G.debug.traceback = function(msg) return msg end
|
||||
vim.paste = function(lines, phase) error("fake fail") end
|
||||
]], {})
|
||||
-- Prepare something for dot-repeat/redo.
|
||||
@@ -514,7 +516,7 @@ describe('TUI', function()
|
||||
foo |
|
||||
|
|
||||
{5: }|
|
||||
{8:paste: Error executing lua: [string "<nvim>"]:2: f}|
|
||||
{8:paste: Error executing lua: [string "<nvim>"]:4: f}|
|
||||
{8:ake fail} |
|
||||
{10:Press ENTER or type command to continue}{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
@@ -579,12 +581,16 @@ describe('TUI', function()
|
||||
|
||||
it("paste: 'nomodifiable' buffer", function()
|
||||
child_session:request('nvim_command', 'set nomodifiable')
|
||||
child_session:request('nvim_exec_lua', [[
|
||||
-- Stack traces for this test are non-deterministic, so disable them
|
||||
_G.debug.traceback = function(msg) return msg end
|
||||
]], {})
|
||||
feed_data('\027[200~fail 1\nfail 2\n\027[201~')
|
||||
screen:expect{grid=[[
|
||||
|
|
||||
{4:~ }|
|
||||
{5: }|
|
||||
{MATCH:paste: Error executing lua: vim.lua:%d+: Vim:E21: }|
|
||||
{8:paste: Error executing lua: vim.lua:243: Vim:E21: }|
|
||||
{8:Cannot make changes, 'modifiable' is off} |
|
||||
{10:Press ENTER or type command to continue}{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
@@ -671,8 +677,8 @@ describe('TUI', function()
|
||||
item 2997 |
|
||||
item 2998 |
|
||||
item 2999 |
|
||||
item 3000 en{1:d}d |
|
||||
{5:[No Name] [+] 5999,13 Bot}|
|
||||
item 3000 en{1:d} |
|
||||
{5:[No Name] [+] 3000,13 Bot}|
|
||||
|
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
|
||||
Reference in New Issue
Block a user