aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/lua/buffer_updates_spec.lua11
-rw-r--r--test/functional/ui/inccommand_spec.lua10
2 files changed, 18 insertions, 3 deletions
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua
index 2009d5f4ba..10de45274c 100644
--- a/test/functional/lua/buffer_updates_spec.lua
+++ b/test/functional/lua/buffer_updates_spec.lua
@@ -252,9 +252,8 @@ describe('lua buffer event callbacks: on_lines', function()
eq(2, meths.win_get_cursor(0)[1])
end)
- it('does not SEGFAULT when calling win_findbuf in on_detach', function()
-
- exec_lua[[
+ it('does not SEGFAULT when accessing window buffer info in on_detach #14998', function()
+ local code = [[
local buf = vim.api.nvim_create_buf(false, false)
vim.cmd"split"
@@ -262,13 +261,19 @@ describe('lua buffer event callbacks: on_lines', function()
vim.api.nvim_buf_attach(buf, false, {
on_detach = function(_, buf)
+ vim.fn.tabpagebuflist()
vim.fn.win_findbuf(buf)
end
})
]]
+ exec_lua(code)
command("q!")
helpers.assert_alive()
+
+ exec_lua(code)
+ command("bd!")
+ helpers.assert_alive()
end)
it('#12718 lnume', function()
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index b01504db4f..a310069636 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -2051,6 +2051,16 @@ describe("'inccommand' split windows", function()
end
end)
+ it("don't open if there's not enough room", function()
+ refresh()
+ screen:try_resize(40, 3)
+ feed("gg:%s/tw")
+ screen:expect([[
+ Inc substitution on |
+ {12:tw}o lines |
+ :%s/tw^ |
+ ]])
+ end)
end)
describe("'inccommand' with 'gdefault'", function()