Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nvim/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ int msg_scrollsize(void)
/*
* Scroll the screen up one line for displaying the next message line.
*/
static void msg_scroll_up(void)
void msg_scroll_up(void)
{
if (!msg_did_scroll) {
ui_call_win_scroll_over_start();
Expand Down
5 changes: 2 additions & 3 deletions src/nvim/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -4765,13 +4765,12 @@ win_redr_status_matches (

row = cmdline_row - 1;
if (row >= 0) {
if (wild_menu_showing == 0) {
if (wild_menu_showing == 0 || wild_menu_showing == WM_LIST) {
if (msg_scrolled > 0) {
/* Put the wildmenu just above the command line. If there is
* no room, scroll the screen one line up. */
if (cmdline_row == Rows - 1) {
grid_del_lines(&default_grid, 0, 1, (int)Rows, 0, (int)Columns);
msg_scrolled++;
msg_scroll_up();
} else {
cmdline_row++;
row++;
Expand Down
37 changes: 37 additions & 0 deletions test/functional/ui/messages_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,43 @@ describe('ui/ext_messages', function()
end)
end)

describe('ui/ext_messages', function()
local screen
before_each(function()
clear()
screen = Screen.new(25, 7)
screen:attach({rgb=true, ext_messages=true})
screen:set_default_attr_ids({
[1] = {bold = true, foreground = Screen.colors.Blue1},
[2] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
[3] = {bold = true, reverse = true},
[4] = {bold = true, foreground = Screen.colors.SeaGreen4},
})
end)

it('wildmode=list', function()
command('set wildmenu wildmode=list')
feed(':set wildm<tab>')
screen:expect{grid=[[
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
]], messages={{
content = {{'wildmenu wildmode'}},
kind = '',
}},
cmdline={{
firstc = ':',
content = {{ 'set wildm' }},
pos = 9,
}}}
end)
end)

describe('ui/builtin messages', function()
local screen
before_each(function()
Expand Down
85 changes: 85 additions & 0 deletions test/functional/ui/wildmode_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,91 @@ describe("'wildmenu'", function()
end)
end)

describe("'wildmenu'", function()
local screen
before_each(function()
clear()
-- screen needs to be more than 5 rows
-- otherwise the tabline is covered and will be redrawn
screen = Screen.new(25, 7)
screen:attach()
end)
after_each(function()
screen:detach()
end)

it('wildmode=list,full and display+=msgsep interact correctly #10092', function()
command('set display+=msgsep')
command('set wildmenu wildmode=list,full')
command('set showtabline=2')
feed(':set wildm<tab>')
screen:expect([[
[No Name] |
|
~ |
|
:set wildm |
wildmenu wildmode |
:set wildm^ |
]])
feed('<tab>') -- trigger wildmode full
screen:expect([[
[No Name] |
|
|
:set wildm |
wildmenu wildmode |
wildmenu wildmode |
:set wildmenu^ |
]])
feed('<Esc>')
screen:expect([[
[No Name] |
^ |
~ |
~ |
~ |
~ |
|
]])
end)

it('wildmode=list,full and display-=msgsep interact correctly', function()
command('set display-=msgsep')
command('set wildmenu wildmode=list,full')
feed(':set wildm<tab>')
screen:expect([[
~ |
~ |
~ |
~ |
:set wildm |
wildmenu wildmode |
:set wildm^ |
]])
feed('<tab>') -- trigger wildmode full
screen:expect([[
~ |
~ |
~ |
:set wildm |
wildmenu wildmode |
wildmenu wildmode |
:set wildmenu^ |
]])
feed('<Esc>')
screen:expect([[
^ |
~ |
~ |
~ |
~ |
~ |
|
]])
end)
end)

describe('command line completion', function()
local screen
before_each(function()
Expand Down