aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/input_spec.lua
diff options
context:
space:
mode:
authorBarrett Ruth <62671086+barrettruth@users.noreply.github.com>2026-08-13 18:38:39 -0500
committerGitHub <noreply@github.com>2026-08-14 07:38:39 +0800
commitfc3f71fb7d5fdc7746576dcf4c896b94d54c4711 (patch)
treef7d729bf0672439d0ed4785cafc1c9ee68dd9860 /test/functional/vimscript/input_spec.lua
parentfaf8345eef8c9a59f254d3e4bafab1a9c125ee21 (diff)
downloadrneovim-fc3f71fb7d5fdc7746576dcf4c896b94d54c4711.tar.gz
rneovim-fc3f71fb7d5fdc7746576dcf4c896b94d54c4711.tar.bz2
rneovim-fc3f71fb7d5fdc7746576dcf4c896b94d54c4711.zip
fix(messages): `inputlist()` offers the mouse when it cannot be used (#41280)
Problem: `inputlist()` advertises "click with the mouse" purely because it implements click selection, so under the default `'mouse'` of "nvi" it offers a click that command-line mode never receives. Solution: Only offer the mouse when `'mouse'` covers command-line mode, the same condition `:help inputlist()` already documents.
Diffstat (limited to 'test/functional/vimscript/input_spec.lua')
-rw-r--r--test/functional/vimscript/input_spec.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua
index f490733a7e..0491242876 100644
--- a/test/functional/vimscript/input_spec.lua
+++ b/test/functional/vimscript/input_spec.lua
@@ -427,6 +427,19 @@ describe('inputdialog()', function()
end)
end)
+describe('inputlist()', function()
+ it("only offers the mouse when 'mouse' applies to cmdline mode", function()
+ screen:try_resize(75, 5)
+ feed(':call inputlist(["foo", "bar"])<CR>')
+ screen:expect({ any = vim.pesc('Type number and <Enter> (q or empty cancels): ') })
+ feed('q')
+ command('set mouse=a')
+ feed(':call inputlist(["foo", "bar"])<CR>')
+ screen:expect({ any = vim.pesc('Type number and <Enter> or click with the mouse') })
+ feed('q')
+ end)
+end)
+
describe('confirm()', function()
it('works', function()
api.nvim_set_option_value('more', false, {}) -- Avoid hit-enter prompt