mirror of
https://github.com/neovim/neovim.git
synced 2026-08-14 11:29:31 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user