mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
feat(ui)!: emit prompt "messages" as cmdline events #31525
Problem: Prompts are emitted as messages events, where cmdline events are more appropriate. The user input is also emitted as message events in fast context, so cannot be displayed with vim.ui_attach(). Solution: Prompt for user input through cmdline prompts.
This commit is contained in:
@@ -270,48 +270,6 @@ describe('vim.ui_attach', function()
|
||||
},
|
||||
},
|
||||
})
|
||||
-- No fast context for prompt message kinds
|
||||
feed(':%s/Function/Replacement/c<cr>')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
^E122: {10:Function} Foo already exists, add !|
|
||||
to replace it |
|
||||
replace with Replacement (y/n/a/q/l/^E/^|
|
||||
Y)? |
|
||||
{1:~ }|
|
||||
]],
|
||||
cmdline = { { abort = false } },
|
||||
messages = {
|
||||
{
|
||||
content = { { 'replace with Replacement (y/n/a/q/l/^E/^Y)?', 6, 18 } },
|
||||
history = true,
|
||||
kind = 'confirm_sub',
|
||||
},
|
||||
},
|
||||
})
|
||||
feed('<esc>:call inputlist(["Select:", "One", "Two"])<cr>')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
E122: {10:Function} Foo already exists, add !|
|
||||
to replace it |
|
||||
Type number and <Enter> or click with th|
|
||||
e mouse (q or empty cancels): |
|
||||
{1:^~ }|
|
||||
]],
|
||||
cmdline = { { abort = false } },
|
||||
messages = {
|
||||
{
|
||||
content = { { 'Select:\nOne\nTwo\n' } },
|
||||
history = false,
|
||||
kind = 'list_cmd',
|
||||
},
|
||||
{
|
||||
content = { { 'Type number and <Enter> or click with the mouse (q or empty cancels): ' } },
|
||||
history = false,
|
||||
kind = 'number_prompt',
|
||||
},
|
||||
},
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
||||
|
Reference in New Issue
Block a user