From 1b0e4a5906d3c9fcb4290f943c7b048b3c35353b Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 4 Nov 2020 10:41:22 +0100 Subject: lua: make vim.inspect available early so it can be used for path debugging --- test/helpers.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/helpers.lua') diff --git a/test/helpers.lua b/test/helpers.lua index 68f0c92244..84148dc1a8 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -139,7 +139,9 @@ function module.pcall_err_withfile(fn, ...) -- C:/long/path/foo.lua:186: Expected string, got number -- to: -- .../foo.lua:0: Expected string, got number - local errmsg = tostring(rv):gsub('[^%s]-[/\\]([^%s:/\\]+):%d+', '.../%1:0') + local errmsg = tostring(rv):gsub('([%s<])vim[/\\]([^%s:/\\]+):%d+', '%1\xffvim\xff%2:0') + :gsub('[^%s<]-[/\\]([^%s:/\\]+):%d+', '.../%1:0') + :gsub('\xffvim\xff', 'vim/') -- Scrub numbers in paths/stacktraces: -- shared.lua:0: in function 'gsplit' -- shared.lua:0: in function ' -- cgit