mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
feat(messages)!: graduate the 'msgsep' feature
The old behaviour (e.g. via `set display-=msgsep`) will not be available. Assuming that messages always are being drawn on msg_grid (or not drawn at all, and forwarded to `ext_messages` enabled UI) will allows some simplifcations and enhancements moving forward.
This commit is contained in:
parent
cce0840cbf
commit
6ae144a921
@ -2128,7 +2128,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
security reasons.
|
||||
|
||||
*'display'* *'dy'*
|
||||
'display' 'dy' string (default "lastline,msgsep")
|
||||
'display' 'dy' string (default "lastline")
|
||||
global
|
||||
Change the way text is displayed. This is a comma-separated list of
|
||||
flags:
|
||||
@ -2140,10 +2140,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
column of the last screen line. Overrules "lastline".
|
||||
uhex Show unprintable characters hexadecimal as <xx>
|
||||
instead of using ^C and ~C.
|
||||
msgsep When showing messages longer than 'cmdheight', only
|
||||
scroll the message lines, not the entire screen. The
|
||||
separator line is decorated by |hl-MsgSeparator| and
|
||||
the "msgsep" flag of 'fillchars'.
|
||||
msgsep Obsolete flag. Allowed but takes no effect. |msgsep|
|
||||
|
||||
When neither "lastline" nor "truncate" is included, a last line that
|
||||
doesn't fit is replaced with "@" lines.
|
||||
|
@ -5187,7 +5187,7 @@ ModeMsg 'showmode' message (e.g., "-- INSERT --").
|
||||
*hl-MsgArea*
|
||||
MsgArea Area for messages and cmdline.
|
||||
*hl-MsgSeparator*
|
||||
MsgSeparator Separator for scrolled messages, `msgsep` flag of 'display'.
|
||||
MsgSeparator Separator for scrolled messages |msgsep|.
|
||||
*hl-MoreMsg*
|
||||
MoreMsg |more-prompt|
|
||||
*hl-NonText*
|
||||
|
@ -608,12 +608,12 @@ tabs.
|
||||
Close the window.
|
||||
|
||||
["msg_set_pos", grid, row, scrolled, sep_char] ~
|
||||
Display messages on `grid`. The grid will be displayed at `row` on the
|
||||
default grid (grid=1), covering the full column width. `scrolled`
|
||||
Display messages on `grid`. The grid will be displayed at `row` on
|
||||
the default grid (grid=1), covering the full column width. `scrolled`
|
||||
indicates whether the message area has been scrolled to cover other
|
||||
grids. It can be useful to draw a separator then ('display' msgsep
|
||||
flag). The Builtin TUI draws a full line filled with `sep_char` and
|
||||
|hl-MsgSeparator| highlight.
|
||||
grids. It can be useful to draw a separator then |msgsep|. The Builtin
|
||||
TUI draws a full line filled with `sep_char` ('fillchars' msgsep
|
||||
field) and |hl-MsgSeparator| highlight.
|
||||
|
||||
When |ui-messages| is active, no message grid is used, and this event
|
||||
will not be sent.
|
||||
|
@ -38,7 +38,7 @@ centralized reference of the differences.
|
||||
- 'complete' excludes "i"
|
||||
- 'cscopeverbose' is enabled
|
||||
- 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
|
||||
- 'display' defaults to "lastline,msgsep"
|
||||
- 'display' defaults to "lastline"
|
||||
- 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding)
|
||||
- 'fillchars' defaults (in effect) to "vert:│,fold:·,sep:│"
|
||||
- 'formatoptions' defaults to "tcqj"
|
||||
@ -256,9 +256,8 @@ Normal commands:
|
||||
|
||||
Options:
|
||||
'cpoptions' flags: |cpo-_|
|
||||
'display' flags: "msgsep" minimizes scrolling when showing messages
|
||||
'guicursor' works in the terminal
|
||||
'fillchars' flags: "msgsep" (see 'display'), "horiz", "horizup",
|
||||
'fillchars' flags: "msgsep", "horiz", "horizup",
|
||||
"horizdown", "vertleft", "vertright", "verthoriz"
|
||||
'foldcolumn' supports up to 9 dynamic/fixed columns
|
||||
'inccommand' shows interactive results for |:substitute|-like commands
|
||||
@ -479,6 +478,11 @@ TUI:
|
||||
UI/Display:
|
||||
|Visual| selection highlights the character at cursor. |visual-use|
|
||||
|
||||
messages: When showing messages longer than 'cmdheight', only
|
||||
scroll the message lines, not the entire screen. The
|
||||
separator line is decorated by |hl-MsgSeparator| and
|
||||
the "msgsep" flag of 'fillchars'. *msgsep*
|
||||
|
||||
Vimscript compatibility:
|
||||
`count` does not alias to |v:count|
|
||||
`errmsg` does not alias to |v:errmsg|
|
||||
|
@ -428,74 +428,41 @@ int update_screen(void)
|
||||
msg_grid.cols, false);
|
||||
}
|
||||
}
|
||||
if (msg_use_msgsep()) {
|
||||
msg_grid.throttled = false;
|
||||
bool was_invalidated = false;
|
||||
msg_grid.throttled = false;
|
||||
bool was_invalidated = false;
|
||||
|
||||
// UPD_CLEAR is already handled
|
||||
if (type == UPD_NOT_VALID && !ui_has(kUIMultigrid) && msg_scrolled) {
|
||||
was_invalidated = ui_comp_set_screen_valid(false);
|
||||
for (int i = valid; i < Rows - p_ch; i++) {
|
||||
grid_clear_line(&default_grid, default_grid.line_offset[i],
|
||||
Columns, false);
|
||||
// UPD_CLEAR is already handled
|
||||
if (type == UPD_NOT_VALID && !ui_has(kUIMultigrid) && msg_scrolled) {
|
||||
was_invalidated = ui_comp_set_screen_valid(false);
|
||||
for (int i = valid; i < Rows - p_ch; i++) {
|
||||
grid_clear_line(&default_grid, default_grid.line_offset[i],
|
||||
Columns, false);
|
||||
}
|
||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||
if (wp->w_floating) {
|
||||
continue;
|
||||
}
|
||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||
if (wp->w_floating) {
|
||||
continue;
|
||||
}
|
||||
if (W_ENDROW(wp) > valid) {
|
||||
// TODO(bfredl): too pessimistic. type could be UPD_NOT_VALID
|
||||
// only because windows that are above the separator.
|
||||
wp->w_redr_type = MAX(wp->w_redr_type, UPD_NOT_VALID);
|
||||
}
|
||||
if (!is_stl_global && W_ENDROW(wp) + wp->w_status_height > valid) {
|
||||
wp->w_redr_status = true;
|
||||
}
|
||||
if (W_ENDROW(wp) > valid) {
|
||||
// TODO(bfredl): too pessimistic. type could be UPD_NOT_VALID
|
||||
// only because windows that are above the separator.
|
||||
wp->w_redr_type = MAX(wp->w_redr_type, UPD_NOT_VALID);
|
||||
}
|
||||
if (is_stl_global && Rows - p_ch - 1 > valid) {
|
||||
curwin->w_redr_status = true;
|
||||
if (!is_stl_global && W_ENDROW(wp) + wp->w_status_height > valid) {
|
||||
wp->w_redr_status = true;
|
||||
}
|
||||
}
|
||||
msg_grid_set_pos(Rows - (int)p_ch, false);
|
||||
msg_grid_invalid = false;
|
||||
if (was_invalidated) {
|
||||
// screen was only invalid for the msgarea part.
|
||||
// @TODO(bfredl): using the same "valid" flag
|
||||
// for both messages and floats moving is bit of a mess.
|
||||
ui_comp_set_screen_valid(true);
|
||||
}
|
||||
} else if (type != UPD_CLEAR) {
|
||||
if (msg_scrolled > Rows - 5) { // redrawing is faster
|
||||
type = UPD_NOT_VALID;
|
||||
} else {
|
||||
check_for_delay(false);
|
||||
grid_ins_lines(&default_grid, 0, msg_scrolled, Rows, 0, Columns);
|
||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||
if (wp->w_floating) {
|
||||
continue;
|
||||
}
|
||||
if (wp->w_winrow < msg_scrolled) {
|
||||
if (W_ENDROW(wp) > msg_scrolled
|
||||
&& wp->w_redr_type < UPD_REDRAW_TOP
|
||||
&& wp->w_lines_valid > 0
|
||||
&& wp->w_topline == wp->w_lines[0].wl_lnum) {
|
||||
wp->w_upd_rows = msg_scrolled - wp->w_winrow;
|
||||
wp->w_redr_type = UPD_REDRAW_TOP;
|
||||
} else {
|
||||
wp->w_redr_type = UPD_NOT_VALID;
|
||||
if (wp->w_winrow + wp->w_winbar_height <= msg_scrolled) {
|
||||
wp->w_redr_status = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_stl_global && Rows - p_ch - 1 <= msg_scrolled) {
|
||||
curwin->w_redr_status = true;
|
||||
}
|
||||
redraw_cmdline = true;
|
||||
redraw_tabline = true;
|
||||
if (is_stl_global && Rows - p_ch - 1 > valid) {
|
||||
curwin->w_redr_status = true;
|
||||
}
|
||||
}
|
||||
msg_grid_set_pos(Rows - (int)p_ch, false);
|
||||
msg_grid_invalid = false;
|
||||
if (was_invalidated) {
|
||||
// screen was only invalid for the msgarea part.
|
||||
// @TODO(bfredl): using the same "valid" flag
|
||||
// for both messages and floats moving is bit of a mess.
|
||||
ui_comp_set_screen_valid(true);
|
||||
}
|
||||
msg_scrolled = 0;
|
||||
msg_scrolled_at_flush = 0;
|
||||
need_wait_return = false;
|
||||
@ -526,9 +493,8 @@ int update_screen(void)
|
||||
default_grid.valid = true;
|
||||
}
|
||||
|
||||
// After disabling msgsep the grid might not have been deallocated yet,
|
||||
// hence we also need to check msg_grid.chars
|
||||
if (type == UPD_NOT_VALID && (msg_use_grid() || msg_grid.chars)) {
|
||||
// might need to clear space on default_grid for the message area.
|
||||
if (type == UPD_NOT_VALID && clear_cmdline && !ui_has(kUIMessages)) {
|
||||
grid_fill(&default_grid, Rows - (int)p_ch, Rows, 0, Columns, ' ', ' ', 0);
|
||||
}
|
||||
|
||||
|
@ -6124,9 +6124,6 @@ static void ex_redrawstatus(exarg_T *eap)
|
||||
} else {
|
||||
status_redraw_curbuf();
|
||||
}
|
||||
if (msg_scrolled && !msg_use_msgsep() && (State & MODE_CMDLINE)) {
|
||||
return; // redraw later
|
||||
}
|
||||
|
||||
RedrawingDisabled = 0;
|
||||
p_lz = false;
|
||||
|
@ -775,7 +775,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent, bool init
|
||||
|
||||
// Redraw the statusline in case it uses the current mode using the mode()
|
||||
// function.
|
||||
if (!cmd_silent && (msg_scrolled == 0 || msg_use_msgsep())) {
|
||||
if (!cmd_silent) {
|
||||
bool found_one = false;
|
||||
|
||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||
|
@ -153,8 +153,7 @@ void msg_grid_set_pos(int row, bool scrolled)
|
||||
|
||||
bool msg_use_grid(void)
|
||||
{
|
||||
return default_grid.chars && msg_use_msgsep()
|
||||
&& !ui_has(kUIMessages);
|
||||
return default_grid.chars && !ui_has(kUIMessages);
|
||||
}
|
||||
|
||||
void msg_grid_validate(void)
|
||||
@ -172,19 +171,17 @@ void msg_grid_validate(void)
|
||||
xfree(msg_grid.dirty_col);
|
||||
msg_grid.dirty_col = xcalloc((size_t)Rows, sizeof(*msg_grid.dirty_col));
|
||||
|
||||
// Tricky: allow resize while pager is active
|
||||
int pos = msg_scrolled ? msg_grid_pos : max_rows;
|
||||
// Tricky: allow resize while pager or ex mode is active
|
||||
int pos = MAX(max_rows - msg_scrolled, 0);
|
||||
msg_grid.throttled = false; // don't throttle in 'cmdheight' area
|
||||
msg_grid_set_pos(pos, msg_scrolled);
|
||||
ui_comp_put_grid(&msg_grid, pos, 0, msg_grid.rows, msg_grid.cols,
|
||||
false, true);
|
||||
ui_call_grid_resize(msg_grid.handle, msg_grid.cols, msg_grid.rows);
|
||||
|
||||
msg_grid.throttled = false; // don't throttle in 'cmdheight' area
|
||||
msg_scrolled_at_flush = msg_scrolled;
|
||||
msg_grid.focusable = false;
|
||||
msg_grid_adj.target = &msg_grid;
|
||||
if (!msg_scrolled) {
|
||||
msg_grid_set_pos(max_rows, false);
|
||||
}
|
||||
} else if (!should_alloc && msg_grid.chars) {
|
||||
ui_comp_remove_grid(&msg_grid);
|
||||
grid_free(&msg_grid);
|
||||
@ -2336,13 +2333,6 @@ int msg_scrollsize(void)
|
||||
return msg_scrolled + (int)p_ch + ((p_ch > 0 || msg_scrolled > 1) ? 1 : 0);
|
||||
}
|
||||
|
||||
bool msg_use_msgsep(void)
|
||||
{
|
||||
// the full-screen scroll behavior doesn't really make sense with
|
||||
// 'ext_multigrid'
|
||||
return (dy_flags & DY_MSGSEP) || p_ch == 0 || ui_has(kUIMultigrid);
|
||||
}
|
||||
|
||||
bool msg_do_throttle(void)
|
||||
{
|
||||
return msg_use_grid() && !(rdb_flags & RDB_NOTHROTTLE);
|
||||
@ -2355,23 +2345,19 @@ void msg_scroll_up(bool may_throttle, bool zerocmd)
|
||||
msg_grid.throttled = true;
|
||||
}
|
||||
msg_did_scroll = true;
|
||||
if (msg_use_msgsep()) {
|
||||
if (msg_grid_pos > 0) {
|
||||
msg_grid_set_pos(msg_grid_pos - 1, !zerocmd);
|
||||
if (msg_grid_pos > 0) {
|
||||
msg_grid_set_pos(msg_grid_pos - 1, !zerocmd);
|
||||
|
||||
// When displaying the first line with cmdheight=0, we need to draw over
|
||||
// the existing last line of the screen.
|
||||
if (zerocmd && msg_grid.chars) {
|
||||
grid_clear_line(&msg_grid, msg_grid.line_offset[0], msg_grid.cols, false);
|
||||
}
|
||||
} else {
|
||||
grid_del_lines(&msg_grid, 0, 1, msg_grid.rows, 0, msg_grid.cols);
|
||||
memmove(msg_grid.dirty_col, msg_grid.dirty_col + 1,
|
||||
(size_t)(msg_grid.rows - 1) * sizeof(*msg_grid.dirty_col));
|
||||
msg_grid.dirty_col[msg_grid.rows - 1] = 0;
|
||||
// When displaying the first line with cmdheight=0, we need to draw over
|
||||
// the existing last line of the screen.
|
||||
if (zerocmd && msg_grid.chars) {
|
||||
grid_clear_line(&msg_grid, msg_grid.line_offset[0], msg_grid.cols, false);
|
||||
}
|
||||
} else {
|
||||
grid_del_lines(&msg_grid_adj, 0, 1, Rows, 0, Columns);
|
||||
grid_del_lines(&msg_grid, 0, 1, msg_grid.rows, 0, msg_grid.cols);
|
||||
memmove(msg_grid.dirty_col, msg_grid.dirty_col + 1,
|
||||
(size_t)(msg_grid.rows - 1) * sizeof(*msg_grid.dirty_col));
|
||||
msg_grid.dirty_col[msg_grid.rows - 1] = 0;
|
||||
}
|
||||
|
||||
grid_fill(&msg_grid_adj, Rows - 1, Rows, 0, Columns, ' ', ' ', HL_ATTR(HLF_MSG));
|
||||
@ -2436,21 +2422,17 @@ void msg_reset_scroll(void)
|
||||
}
|
||||
// TODO(bfredl): some duplicate logic with update_screen(). Later on
|
||||
// we should properly disentangle message clear with full screen redraw.
|
||||
if (msg_use_grid()) {
|
||||
msg_grid.throttled = false;
|
||||
// TODO(bfredl): risk for extra flicker i e with
|
||||
// "nvim -o has_swap also_has_swap"
|
||||
msg_grid_set_pos(Rows - (int)p_ch, false);
|
||||
clear_cmdline = true;
|
||||
if (msg_grid.chars) {
|
||||
// non-displayed part of msg_grid is considered invalid.
|
||||
for (int i = 0; i < MIN(msg_scrollsize(), msg_grid.rows); i++) {
|
||||
grid_clear_line(&msg_grid, msg_grid.line_offset[i],
|
||||
msg_grid.cols, false);
|
||||
}
|
||||
msg_grid.throttled = false;
|
||||
// TODO(bfredl): risk for extra flicker i e with
|
||||
// "nvim -o has_swap also_has_swap"
|
||||
msg_grid_set_pos(Rows - (int)p_ch, false);
|
||||
clear_cmdline = true;
|
||||
if (msg_grid.chars) {
|
||||
// non-displayed part of msg_grid is considered invalid.
|
||||
for (int i = 0; i < MIN(msg_scrollsize(), msg_grid.rows); i++) {
|
||||
grid_clear_line(&msg_grid, msg_grid.line_offset[i],
|
||||
msg_grid.cols, false);
|
||||
}
|
||||
} else {
|
||||
redraw_all_later(UPD_NOT_VALID);
|
||||
}
|
||||
msg_scrolled = 0;
|
||||
msg_scrolled_at_flush = 0;
|
||||
|
@ -492,7 +492,7 @@ EXTERN unsigned dy_flags;
|
||||
#define DY_LASTLINE 0x001
|
||||
#define DY_TRUNCATE 0x002
|
||||
#define DY_UHEX 0x004
|
||||
// code should use msg_use_msgsep() to check if msgsep is active
|
||||
// legacy flag, not used
|
||||
#define DY_MSGSEP 0x008
|
||||
EXTERN int p_ed; // 'edcompatible'
|
||||
EXTERN char *p_ead; // 'eadirection'
|
||||
|
@ -660,7 +660,7 @@ return {
|
||||
deny_duplicates=true,
|
||||
redraw={'all_windows'},
|
||||
varname='p_dy',
|
||||
defaults={if_true="lastline,msgsep"}
|
||||
defaults={if_true="lastline"}
|
||||
},
|
||||
{
|
||||
full_name='eadirection', abbreviation='ead',
|
||||
|
@ -166,7 +166,7 @@ describe('fileio', function()
|
||||
[3] = {bold = true, foreground = Screen.colors.SeaGreen4}
|
||||
})
|
||||
screen:attach()
|
||||
command("set display-=msgsep shortmess-=F")
|
||||
command("set shortmess-=F")
|
||||
|
||||
command("e Xtest-overwrite-forced")
|
||||
screen:expect([[
|
||||
|
@ -172,83 +172,6 @@ describe('cmdline', function()
|
||||
|
|
||||
]])
|
||||
end)
|
||||
|
||||
-- oldtest: Test_redrawstatus_in_autocmd()
|
||||
it(':redrawstatus in cmdline mode', function()
|
||||
local screen = Screen.new(60, 8)
|
||||
screen:set_default_attr_ids({
|
||||
[0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
|
||||
[1] = {bold = true, reverse = true}, -- MsgSeparator, StatusLine
|
||||
})
|
||||
screen:attach()
|
||||
exec([[
|
||||
set laststatus=2
|
||||
set statusline=%=:%{getcmdline()}
|
||||
autocmd CmdlineChanged * redrawstatus
|
||||
set display-=msgsep
|
||||
]])
|
||||
-- :redrawstatus is postponed if messages have scrolled
|
||||
feed([[:echo "one\ntwo\nthree\nfour"<CR>]])
|
||||
feed(':foobar')
|
||||
screen:expect([[
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{1: :echo "one\ntwo\nthree\nfour"}|
|
||||
one |
|
||||
two |
|
||||
three |
|
||||
four |
|
||||
:foobar^ |
|
||||
]])
|
||||
-- it is not postponed if messages have not scrolled
|
||||
feed('<Esc>:for in in range(3)')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{1: :for in in range(3)}|
|
||||
:for in in range(3)^ |
|
||||
]])
|
||||
-- with cmdheight=1 messages have scrolled when typing :endfor
|
||||
feed('<CR>:endfor')
|
||||
screen:expect([[
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{1: :for in in range(3)}|
|
||||
:for in in range(3) |
|
||||
: :endfor^ |
|
||||
]])
|
||||
feed('<CR>:set cmdheight=2<CR>')
|
||||
-- with cmdheight=2 messages haven't scrolled when typing :for or :endfor
|
||||
feed(':for in in range(3)')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{1: :for in in range(3)}|
|
||||
:for in in range(3)^ |
|
||||
|
|
||||
]])
|
||||
feed('<CR>:endfor')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{1: ::endfor}|
|
||||
:for in in range(3) |
|
||||
: :endfor^ |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('cmdwin', function()
|
||||
|
@ -822,7 +822,7 @@ describe('statusline is redrawn on entering cmdline', function()
|
||||
]]}
|
||||
end)
|
||||
|
||||
it('with scrolled messages and msgsep', function()
|
||||
it('with scrolled messages', function()
|
||||
screen:try_resize(35,14)
|
||||
exec([[
|
||||
let g:count = 0
|
||||
@ -904,70 +904,6 @@ describe('statusline is redrawn on entering cmdline', function()
|
||||
]]}
|
||||
end)
|
||||
|
||||
it('but not with scrolled messages without msgsep', function()
|
||||
screen:try_resize(35,10)
|
||||
exec([[
|
||||
let g:count = 0
|
||||
autocmd CmdlineEnter * let g:count += 1
|
||||
set display-=msgsep
|
||||
set statusline=%{mode()}%{g:count}
|
||||
]])
|
||||
feed(':echoerr doesnotexist<cr>')
|
||||
screen:expect{grid=[[
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{3:c1 }|
|
||||
{4:E121: Undefined variable: doesnotex}|
|
||||
{4:ist} |
|
||||
{5:Press ENTER or type command to cont}|
|
||||
{5:inue}^ |
|
||||
]]}
|
||||
feed(':echoerr doesnotexist<cr>')
|
||||
screen:expect{grid=[[
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{3:c1 }|
|
||||
{4:E121: Undefined variable: doesnotex}|
|
||||
{4:ist} |
|
||||
{5:Press ENTER or type command to cont}|
|
||||
{4:E121: Undefined variable: doesnotex}|
|
||||
{4:ist} |
|
||||
{5:Press ENTER or type command to cont}|
|
||||
{5:inue}^ |
|
||||
]]}
|
||||
|
||||
feed(':echoerr doesnotexist<cr>')
|
||||
screen:expect{grid=[[
|
||||
{4:E121: Undefined variable: doesnotex}|
|
||||
{4:ist} |
|
||||
{5:Press ENTER or type command to cont}|
|
||||
{4:E121: Undefined variable: doesnotex}|
|
||||
{4:ist} |
|
||||
{5:Press ENTER or type command to cont}|
|
||||
{4:E121: Undefined variable: doesnotex}|
|
||||
{4:ist} |
|
||||
{5:Press ENTER or type command to cont}|
|
||||
{5:inue}^ |
|
||||
]]}
|
||||
|
||||
feed('<cr>')
|
||||
screen:expect{grid=[[
|
||||
^ |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{3:n3 }|
|
||||
|
|
||||
]]}
|
||||
end)
|
||||
|
||||
describe('if custom statusline is set by', function()
|
||||
before_each(function()
|
||||
command('set statusline=')
|
||||
|
@ -82,20 +82,6 @@ local function test_embed(ext_linegrid)
|
||||
eq(Screen.colors.Green, screen.default_colors.rgb_bg)
|
||||
end}
|
||||
end)
|
||||
|
||||
it("set display-=msgsep before first redraw", function()
|
||||
startup('--cmd', 'set display-=msgsep')
|
||||
screen:expect{grid=[[
|
||||
^ |
|
||||
{3:~ }|
|
||||
{3:~ }|
|
||||
{3:~ }|
|
||||
{3:~ }|
|
||||
{3:~ }|
|
||||
{3:~ }|
|
||||
|
|
||||
]]}
|
||||
end)
|
||||
end
|
||||
|
||||
describe('--embed UI on startup (ext_linegrid=true)', function() test_embed(true) end)
|
||||
|
@ -1560,17 +1560,6 @@ describe("MsgSeparator highlight and msgsep fillchar", function()
|
||||
1 %a "[No Name]" line 1 |
|
||||
{3:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
|
||||
-- when display doesn't contain msgsep, these options have no effect
|
||||
feed_command("set display-=msgsep")
|
||||
feed_command("ls")
|
||||
screen:expect([[
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
:ls |
|
||||
1 %a "[No Name]" line 1 |
|
||||
{3:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
end)
|
||||
|
||||
it("and MsgArea", function()
|
||||
|
@ -1200,28 +1200,6 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
|
||||
it('prints lines in Ex mode correctly with a burst of carriage returns #19341', function()
|
||||
command('set number')
|
||||
meths.buf_set_lines(0, 0, 0, true, {'aaa', 'bbb', 'ccc'})
|
||||
command('set display-=msgsep')
|
||||
feed('gggQ<CR><CR>1<CR><CR>vi')
|
||||
screen:expect([[
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
{11: 2 }bbb |
|
||||
{11: 3 }ccc |
|
||||
:1 |
|
||||
{11: 1 }aaa |
|
||||
{11: 2 }bbb |
|
||||
:vi^ |
|
||||
]])
|
||||
feed('<CR>')
|
||||
screen:expect([[
|
||||
{11: 1 }aaa |
|
||||
{11: 2 }^bbb |
|
||||
{11: 3 }ccc |
|
||||
{11: 4 } |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]])
|
||||
command('set display+=msgsep')
|
||||
feed('gggQ<CR><CR>1<CR><CR>vi')
|
||||
screen:expect([[
|
||||
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||
|
@ -682,30 +682,7 @@ local function screen_tests(linegrid)
|
||||
]])
|
||||
end)
|
||||
|
||||
it('execute command with multi-line output without msgsep', function()
|
||||
command("set display-=msgsep")
|
||||
feed(':ls<cr>')
|
||||
screen:expect([[
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
:ls |
|
||||
1 %a "[No Name]" line 1 |
|
||||
{7:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
feed('<cr>') -- skip the "Press ENTER..." state or tests will hang
|
||||
end)
|
||||
|
||||
it('execute command with multi-line output and with msgsep', function()
|
||||
command("set display+=msgsep")
|
||||
it('execute command with multi-line output', function()
|
||||
feed(':ls<cr>')
|
||||
screen:expect([[
|
||||
|
|
||||
@ -1050,39 +1027,3 @@ describe('Screen default colors', function()
|
||||
end}
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
describe('screen with msgsep deactivated on startup', function()
|
||||
local screen
|
||||
|
||||
before_each(function()
|
||||
clear('--cmd', 'set display-=msgsep')
|
||||
screen = Screen.new()
|
||||
screen:attach()
|
||||
screen:set_default_attr_ids {
|
||||
[0] = {bold=true, foreground=255};
|
||||
[7] = {bold = true, foreground = Screen.colors.SeaGreen};
|
||||
}
|
||||
end)
|
||||
|
||||
it('execute command with multi-line output', function()
|
||||
feed ':ls<cr>'
|
||||
screen:expect([[
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
:ls |
|
||||
1 %a "[No Name]" line 1 |
|
||||
{7:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
feed '<cr>' -- skip the "Press ENTER..." state or tests will hang
|
||||
end)
|
||||
end)
|
||||
|
@ -184,11 +184,10 @@ describe("'wildmenu'", function()
|
||||
screen:expect_unchanged()
|
||||
end)
|
||||
|
||||
it('wildmode=list,full and display+=msgsep interaction #10092', function()
|
||||
it('wildmode=list,full and messages interaction #10092', function()
|
||||
-- Need more than 5 rows, else tabline is covered and will be redrawn.
|
||||
screen:try_resize(25, 7)
|
||||
|
||||
command('set display+=msgsep')
|
||||
command('set wildmenu wildmode=list,full')
|
||||
command('set showtabline=2')
|
||||
feed(':set wildm<tab>')
|
||||
@ -223,44 +222,6 @@ describe("'wildmenu'", function()
|
||||
]])
|
||||
end)
|
||||
|
||||
it('wildmode=list,full and display-=msgsep interaction', function()
|
||||
-- Need more than 5 rows, else tabline is covered and will be redrawn.
|
||||
screen:try_resize(25, 7)
|
||||
|
||||
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)
|
||||
|
||||
it('wildmode=longest,list', function()
|
||||
-- Need more than 5 rows, else tabline is covered and will be redrawn.
|
||||
screen:try_resize(25, 7)
|
||||
@ -365,7 +326,6 @@ describe("'wildmenu'", function()
|
||||
screen:try_resize(25, 7)
|
||||
|
||||
command('set laststatus=2')
|
||||
command('set display+=msgsep')
|
||||
feed(':set wildm')
|
||||
feed('<c-d>')
|
||||
screen:expect([[
|
||||
|
Loading…
Reference in New Issue
Block a user