mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 07:28:34 +00:00
win_redr_status(): skip if wildmenu is showing
This might be too coarse, but it passes all tests ... A more nuanced approach might be: only skip the windows whose statuslines are overwritten by the wildmenu. Closes #2255 Closes #7108 vim-patch:8.0.0710 N/A because of the changes in this commit.
This commit is contained in:
@@ -86,6 +86,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "nvim/log.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/arabic.h"
|
#include "nvim/arabic.h"
|
||||||
@@ -4874,11 +4875,14 @@ void win_redr_status(win_T *wp)
|
|||||||
int this_ru_col;
|
int this_ru_col;
|
||||||
static int busy = FALSE;
|
static int busy = FALSE;
|
||||||
|
|
||||||
/* It's possible to get here recursively when 'statusline' (indirectly)
|
// May get here recursively when 'statusline' (indirectly)
|
||||||
* invokes ":redrawstatus". Simply ignore the call then. */
|
// invokes ":redrawstatus". Simply ignore the call then.
|
||||||
if (busy)
|
if (busy
|
||||||
|
// Also ignore if wildmenu is showing.
|
||||||
|
|| (wild_menu_showing != 0 && !ui_is_external(kUIWildmenu))) {
|
||||||
return;
|
return;
|
||||||
busy = TRUE;
|
}
|
||||||
|
busy = true;
|
||||||
|
|
||||||
wp->w_redr_status = FALSE;
|
wp->w_redr_status = FALSE;
|
||||||
if (wp->w_status_height == 0) {
|
if (wp->w_status_height == 0) {
|
||||||
@@ -6441,13 +6445,11 @@ void setcursor(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/// Insert 'line_count' lines at 'row' in window 'wp'.
|
||||||
* insert 'line_count' lines at 'row' in window 'wp'
|
/// If 'invalid' is TRUE the wp->w_lines[].wl_lnum is invalidated.
|
||||||
* if 'invalid' is TRUE the wp->w_lines[].wl_lnum is invalidated.
|
/// If 'mayclear' is TRUE the screen will be cleared if it is faster than
|
||||||
* if 'mayclear' is TRUE the screen will be cleared if it is faster than
|
/// scrolling.
|
||||||
* scrolling.
|
/// Returns FAIL if the lines are not inserted, OK for success.
|
||||||
* Returns FAIL if the lines are not inserted, OK for success.
|
|
||||||
*/
|
|
||||||
int win_ins_lines(win_T *wp, int row, int line_count, int invalid, int mayclear)
|
int win_ins_lines(win_T *wp, int row, int line_count, int invalid, int mayclear)
|
||||||
{
|
{
|
||||||
int did_delete;
|
int did_delete;
|
||||||
@@ -6510,13 +6512,11 @@ int win_ins_lines(win_T *wp, int row, int line_count, int invalid, int mayclear)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/// Delete "line_count" window lines at "row" in window "wp".
|
||||||
* delete "line_count" window lines at "row" in window "wp"
|
/// If "invalid" is TRUE curwin->w_lines[] is invalidated.
|
||||||
* If "invalid" is TRUE curwin->w_lines[] is invalidated.
|
/// If "mayclear" is TRUE the screen will be cleared if it is faster than
|
||||||
* If "mayclear" is TRUE the screen will be cleared if it is faster than
|
/// scrolling
|
||||||
* scrolling
|
/// Return OK for success, FAIL if the lines are not deleted.
|
||||||
* Return OK for success, FAIL if the lines are not deleted.
|
|
||||||
*/
|
|
||||||
int win_del_lines(win_T *wp, int row, int line_count, int invalid, int mayclear)
|
int win_del_lines(win_T *wp, int row, int line_count, int invalid, int mayclear)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
@@ -77,6 +77,229 @@ static char *features[] = {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const int included_patches[] = {
|
static const int included_patches[] = {
|
||||||
|
// 875,
|
||||||
|
// 874,
|
||||||
|
// 873,
|
||||||
|
// 872,
|
||||||
|
// 871,
|
||||||
|
// 870,
|
||||||
|
// 869,
|
||||||
|
// 868,
|
||||||
|
// 867,
|
||||||
|
// 866,
|
||||||
|
// 865,
|
||||||
|
// 864,
|
||||||
|
// 863,
|
||||||
|
// 862,
|
||||||
|
// 861,
|
||||||
|
// 860,
|
||||||
|
// 859,
|
||||||
|
// 858,
|
||||||
|
// 857,
|
||||||
|
// 856,
|
||||||
|
// 855,
|
||||||
|
// 854,
|
||||||
|
// 853,
|
||||||
|
// 852,
|
||||||
|
// 851,
|
||||||
|
// 850,
|
||||||
|
// 849,
|
||||||
|
// 848,
|
||||||
|
// 847,
|
||||||
|
// 846,
|
||||||
|
// 845,
|
||||||
|
// 844,
|
||||||
|
// 843,
|
||||||
|
// 842,
|
||||||
|
// 841,
|
||||||
|
// 840,
|
||||||
|
// 839,
|
||||||
|
// 838,
|
||||||
|
// 837,
|
||||||
|
// 836,
|
||||||
|
// 835,
|
||||||
|
// 834,
|
||||||
|
// 833,
|
||||||
|
// 832,
|
||||||
|
// 831,
|
||||||
|
// 830,
|
||||||
|
// 829,
|
||||||
|
// 828,
|
||||||
|
// 827,
|
||||||
|
// 826,
|
||||||
|
// 825,
|
||||||
|
// 824,
|
||||||
|
// 823,
|
||||||
|
// 822,
|
||||||
|
// 821,
|
||||||
|
// 820,
|
||||||
|
// 819,
|
||||||
|
// 818,
|
||||||
|
// 817,
|
||||||
|
// 816,
|
||||||
|
// 815,
|
||||||
|
// 814,
|
||||||
|
// 813,
|
||||||
|
// 812,
|
||||||
|
// 811,
|
||||||
|
// 810,
|
||||||
|
// 809,
|
||||||
|
// 808,
|
||||||
|
// 807,
|
||||||
|
// 806,
|
||||||
|
// 805,
|
||||||
|
// 804,
|
||||||
|
// 803,
|
||||||
|
// 802,
|
||||||
|
// 801,
|
||||||
|
// 800,
|
||||||
|
// 799,
|
||||||
|
// 798,
|
||||||
|
// 797,
|
||||||
|
// 796,
|
||||||
|
// 795,
|
||||||
|
// 794,
|
||||||
|
// 793,
|
||||||
|
// 792,
|
||||||
|
// 791,
|
||||||
|
// 790,
|
||||||
|
// 789,
|
||||||
|
// 788,
|
||||||
|
// 787,
|
||||||
|
// 786,
|
||||||
|
// 785,
|
||||||
|
// 784,
|
||||||
|
// 783,
|
||||||
|
// 782,
|
||||||
|
// 781,
|
||||||
|
// 780,
|
||||||
|
// 779,
|
||||||
|
// 778,
|
||||||
|
// 777,
|
||||||
|
// 776,
|
||||||
|
// 775,
|
||||||
|
// 774,
|
||||||
|
// 773,
|
||||||
|
// 772,
|
||||||
|
// 771,
|
||||||
|
// 770,
|
||||||
|
// 769,
|
||||||
|
// 768,
|
||||||
|
// 767,
|
||||||
|
// 766,
|
||||||
|
// 765,
|
||||||
|
// 764,
|
||||||
|
// 763,
|
||||||
|
// 762,
|
||||||
|
// 761,
|
||||||
|
// 760,
|
||||||
|
// 759,
|
||||||
|
// 758,
|
||||||
|
// 757,
|
||||||
|
// 756,
|
||||||
|
// 755,
|
||||||
|
// 754,
|
||||||
|
// 753,
|
||||||
|
// 752,
|
||||||
|
// 751,
|
||||||
|
// 750,
|
||||||
|
// 749,
|
||||||
|
// 748,
|
||||||
|
// 747,
|
||||||
|
// 746,
|
||||||
|
// 745,
|
||||||
|
// 744,
|
||||||
|
// 743,
|
||||||
|
// 742,
|
||||||
|
// 741,
|
||||||
|
// 740,
|
||||||
|
// 739,
|
||||||
|
// 738,
|
||||||
|
// 737,
|
||||||
|
// 736,
|
||||||
|
// 735,
|
||||||
|
// 734,
|
||||||
|
// 733,
|
||||||
|
// 732,
|
||||||
|
// 731,
|
||||||
|
// 730,
|
||||||
|
// 729,
|
||||||
|
// 728,
|
||||||
|
// 727,
|
||||||
|
// 726,
|
||||||
|
// 725,
|
||||||
|
// 724,
|
||||||
|
// 723,
|
||||||
|
// 722,
|
||||||
|
// 721,
|
||||||
|
// 720,
|
||||||
|
// 719,
|
||||||
|
// 718,
|
||||||
|
// 717,
|
||||||
|
// 716,
|
||||||
|
// 715,
|
||||||
|
// 714,
|
||||||
|
// 713,
|
||||||
|
// 712,
|
||||||
|
// 711,
|
||||||
|
710,
|
||||||
|
// 709,
|
||||||
|
// 708,
|
||||||
|
// 707,
|
||||||
|
// 706,
|
||||||
|
// 705,
|
||||||
|
// 704,
|
||||||
|
// 703,
|
||||||
|
// 702,
|
||||||
|
// 701,
|
||||||
|
// 700,
|
||||||
|
// 699,
|
||||||
|
// 698,
|
||||||
|
// 697,
|
||||||
|
// 696,
|
||||||
|
// 695,
|
||||||
|
// 694,
|
||||||
|
// 693,
|
||||||
|
// 692,
|
||||||
|
// 691,
|
||||||
|
// 690,
|
||||||
|
// 689,
|
||||||
|
// 688,
|
||||||
|
// 687,
|
||||||
|
// 686,
|
||||||
|
// 685,
|
||||||
|
// 684,
|
||||||
|
// 683,
|
||||||
|
// 682,
|
||||||
|
// 681,
|
||||||
|
// 680,
|
||||||
|
// 679,
|
||||||
|
// 678,
|
||||||
|
// 677,
|
||||||
|
// 676,
|
||||||
|
// 675,
|
||||||
|
// 674,
|
||||||
|
// 673,
|
||||||
|
// 672,
|
||||||
|
// 671,
|
||||||
|
// 670,
|
||||||
|
// 669,
|
||||||
|
// 668,
|
||||||
|
// 667,
|
||||||
|
// 666,
|
||||||
|
// 665,
|
||||||
|
// 664,
|
||||||
|
// 663,
|
||||||
|
// 662,
|
||||||
|
// 661,
|
||||||
|
// 660,
|
||||||
|
// 659,
|
||||||
|
// 658,
|
||||||
|
// 657,
|
||||||
|
// 656,
|
||||||
|
// 655,
|
||||||
|
// 654,
|
||||||
|
// 653,
|
||||||
652,
|
652,
|
||||||
// 651,
|
// 651,
|
||||||
// 650,
|
// 650,
|
||||||
|
@@ -1,24 +1,24 @@
|
|||||||
local helpers = require('test.functional.helpers')(after_each)
|
local helpers = require('test.functional.helpers')(after_each)
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
|
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
|
||||||
|
local iswin, set_shell_powershell = helpers.iswin, helpers.set_shell_powershell
|
||||||
|
local nvim_dir = helpers.nvim_dir
|
||||||
local funcs = helpers.funcs
|
local funcs = helpers.funcs
|
||||||
|
local eq = helpers.eq
|
||||||
|
local eval = helpers.eval
|
||||||
|
local retry = helpers.retry
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
describe("'wildmenu'", function()
|
||||||
|
|
||||||
describe("'wildmode'", function()
|
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
screen = Screen.new(25, 5)
|
screen = Screen.new(25, 5)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
after_each(function()
|
after_each(function()
|
||||||
screen:detach()
|
screen:detach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe("'wildmenu'", function()
|
|
||||||
it(':sign <tab> shows wildmenu completions', function()
|
it(':sign <tab> shows wildmenu completions', function()
|
||||||
command('set wildmode=full')
|
command('set wildmode=full')
|
||||||
command('set wildmenu')
|
command('set wildmenu')
|
||||||
@@ -52,6 +52,82 @@ describe("'wildmode'", function()
|
|||||||
:!^ |
|
:!^ |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('is preserved during :terminal activity', function()
|
||||||
|
-- Because this test verifies a _lack_ of activity after screen:sleep(), we
|
||||||
|
-- must wait the full timeout. So make it reasonable.
|
||||||
|
screen.timeout = 1000
|
||||||
|
|
||||||
|
command('set wildmenu wildmode=full')
|
||||||
|
command('set scrollback=4')
|
||||||
|
if iswin() then
|
||||||
|
if helpers.pending_win32(pending) then return end
|
||||||
|
-- feed([[:terminal 1,2,3,4,5 | foreach-object -process {echo $_; sleep 0.1}]])
|
||||||
|
else
|
||||||
|
feed([[:terminal for i in $(seq 1 5000); do printf 'foo\nfoo\nfoo\n'; sleep 0.1; done<cr>]])
|
||||||
|
end
|
||||||
|
screen:sleep(50) -- Allow some output.
|
||||||
|
feed([[<C-\><C-N>gg]])
|
||||||
|
feed([[:sign <Tab>]]) -- Invoke wildmenu.
|
||||||
|
screen:sleep(50) -- Allow some output.
|
||||||
|
screen:expect([[
|
||||||
|
foo |
|
||||||
|
foo |
|
||||||
|
foo |
|
||||||
|
define jump list > |
|
||||||
|
:sign define^ |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('ignores :redrawstatus called from a timer #7108', function()
|
||||||
|
-- Because this test verifies a _lack_ of activity after screen:sleep(), we
|
||||||
|
-- must wait the full timeout. So make it reasonable.
|
||||||
|
screen.timeout = 1000
|
||||||
|
|
||||||
|
command('set wildmenu wildmode=full')
|
||||||
|
command([[call timer_start(10, {->execute('redrawstatus')}, {'repeat':-1})]])
|
||||||
|
feed([[<C-\><C-N>]])
|
||||||
|
feed([[:sign <Tab>]]) -- Invoke wildmenu.
|
||||||
|
screen:sleep(30) -- Allow some timer activity.
|
||||||
|
screen:expect([[
|
||||||
|
|
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
define jump list > |
|
||||||
|
:sign define^ |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('with laststatus=0, :vsplit, :term #2255', function()
|
||||||
|
-- Because this test verifies a _lack_ of activity after screen:sleep(), we
|
||||||
|
-- must wait the full timeout. So make it reasonable.
|
||||||
|
screen.timeout = 1000
|
||||||
|
|
||||||
|
if iswin() then
|
||||||
|
set_shell_powershell()
|
||||||
|
else
|
||||||
|
command('set shell=sh')
|
||||||
|
end
|
||||||
|
|
||||||
|
command('set laststatus=0')
|
||||||
|
command('vsplit')
|
||||||
|
command('term')
|
||||||
|
|
||||||
|
-- Check for a shell prompt to verify that the terminal loaded.
|
||||||
|
retry(nil, nil, function()
|
||||||
|
if iswin() then
|
||||||
|
eq('PS', eval("matchstr(join(getline(1, '$')), 'PS')"))
|
||||||
|
else
|
||||||
|
eq('$', eval([[matchstr(getline(1), '\$')]]))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
feed([[<C-\><C-N>]])
|
||||||
|
feed([[:<Tab>]]) -- Invoke wildmenu.
|
||||||
|
screen:sleep(10) -- Flush
|
||||||
|
-- Check only the last 2 lines, because the shell output is
|
||||||
|
-- system-dependent.
|
||||||
|
screen:expect('! # & < = > @ > \n:!^', nil, nil, nil, true)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user