summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/ui/inccommand_user_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/inccommand_user_spec.lua')
-rw-r--r--test/functional/ui/inccommand_user_spec.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/ui/inccommand_user_spec.lua b/test/functional/ui/inccommand_user_spec.lua
index ef715ba832..f4394e36ce 100644
--- a/test/functional/ui/inccommand_user_spec.lua
+++ b/test/functional/ui/inccommand_user_spec.lua
@@ -1,6 +1,8 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
+local meths = helpers.meths
local clear = helpers.clear
+local eq = helpers.eq
local exec_lua = helpers.exec_lua
local insert = helpers.insert
local feed = helpers.feed
@@ -543,6 +545,22 @@ describe("'inccommand' for user commands", function()
test_preview_break_undo()
end)
end)
+
+ it('disables preview if preview buffer cannot be created #27086', function()
+ command('set inccommand=split')
+ meths.buf_set_name(0, '[Preview]')
+ exec_lua([[
+ vim.api.nvim_create_user_command('Test', function() end, {
+ nargs = '*',
+ preview = function(_, _, _)
+ return 2
+ end
+ })
+ ]])
+ eq('split', meths.get_option_value('inccommand', {}))
+ feed(':Test')
+ eq('nosplit', meths.get_option_value('inccommand', {}))
+ end)
end)
describe("'inccommand' with multiple buffers", function()