From fc3f71fb7d5fdc7746576dcf4c896b94d54c4711 Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Thu, 13 Aug 2026 18:38:39 -0500 Subject: 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. --- test/functional/vimscript/input_spec.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/functional/vimscript/input_spec.lua') 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"])') + screen:expect({ any = vim.pesc('Type number and (q or empty cancels): ') }) + feed('q') + command('set mouse=a') + feed(':call inputlist(["foo", "bar"])') + screen:expect({ any = vim.pesc('Type number and 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 -- cgit