mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
Merge pull request #11126 from bfredl/invalidcell-0.4
[release-0.4] screen: don't crash on invalid grid cells being recomposed
This commit is contained in:
@@ -4583,6 +4583,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
RedrawDebugRecompose guibg=Red redraw generated by the
|
RedrawDebugRecompose guibg=Red redraw generated by the
|
||||||
compositor itself, due to a
|
compositor itself, due to a
|
||||||
grid being moved or deleted.
|
grid being moved or deleted.
|
||||||
|
nothrottle Turn off throttling of the message grid. This is an
|
||||||
|
optimization that joins many small scrolls to one
|
||||||
|
larger scroll when drawing the message area (with
|
||||||
|
'display' msgsep flag active).
|
||||||
|
invalid Enable stricter checking (abort) of inconsistencies
|
||||||
|
of the internal screen state. This is mosly
|
||||||
|
useful when running nvim inside a debugger (and
|
||||||
|
the test suite).
|
||||||
|
|
||||||
*'redrawtime'* *'rdt'*
|
*'redrawtime'* *'rdt'*
|
||||||
'redrawtime' 'rdt' number (default 2000)
|
'redrawtime' 'rdt' number (default 2000)
|
||||||
|
@@ -518,10 +518,11 @@ EXTERN long p_pyx; // 'pyxversion'
|
|||||||
EXTERN char_u *p_rdb; // 'redrawdebug'
|
EXTERN char_u *p_rdb; // 'redrawdebug'
|
||||||
EXTERN unsigned rdb_flags;
|
EXTERN unsigned rdb_flags;
|
||||||
# ifdef IN_OPTION_C
|
# ifdef IN_OPTION_C
|
||||||
static char *(p_rdb_values[]) = { "compositor", "nothrottle", NULL };
|
static char *(p_rdb_values[]) = { "compositor", "nothrottle", "invalid", NULL };
|
||||||
# endif
|
# endif
|
||||||
# define RDB_COMPOSITOR 0x001
|
# define RDB_COMPOSITOR 0x001
|
||||||
# define RDB_NOTHROTTLE 0x002
|
# define RDB_NOTHROTTLE 0x002
|
||||||
|
# define RDB_INVALID 0x004
|
||||||
|
|
||||||
EXTERN long p_rdt; // 'redrawtime'
|
EXTERN long p_rdt; // 'redrawtime'
|
||||||
EXTERN int p_remap; // 'remap'
|
EXTERN int p_remap; // 'remap'
|
||||||
|
@@ -425,6 +425,15 @@ static void compose_line(Integer row, Integer startcol, Integer endcol,
|
|||||||
flags = flags & ~kLineFlagWrap;
|
flags = flags & ~kLineFlagWrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = skipstart; i < (endcol-skipend)-startcol; i++) {
|
||||||
|
if (attrbuf[i] < 0) {
|
||||||
|
if (rdb_flags & RDB_INVALID) {
|
||||||
|
abort();
|
||||||
|
} else {
|
||||||
|
attrbuf[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ui_composed_call_raw_line(1, row, startcol+skipstart,
|
ui_composed_call_raw_line(1, row, startcol+skipstart,
|
||||||
endcol-skipend, endcol-skipend, 0, flags,
|
endcol-skipend, endcol-skipend, 0, flags,
|
||||||
(const schar_T *)linebuf+skipstart,
|
(const schar_T *)linebuf+skipstart,
|
||||||
@@ -535,6 +544,11 @@ static void ui_comp_raw_line(UI *ui, Integer grid, Integer row,
|
|||||||
} else {
|
} else {
|
||||||
compose_debug(row, row+1, startcol, endcol, dbghl_normal, false);
|
compose_debug(row, row+1, startcol, endcol, dbghl_normal, false);
|
||||||
compose_debug(row, row+1, endcol, clearcol, dbghl_clear, true);
|
compose_debug(row, row+1, endcol, clearcol, dbghl_clear, true);
|
||||||
|
#ifndef NDEBUG
|
||||||
|
for (int i = 0; i < endcol-startcol; i++) {
|
||||||
|
assert(attrs[i] >= 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
ui_composed_call_raw_line(1, row, startcol, endcol, clearcol, clearattr,
|
ui_composed_call_raw_line(1, row, startcol, endcol, clearcol, clearattr,
|
||||||
flags, chunk, attrs);
|
flags, chunk, attrs);
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@ module.nvim_prog = (
|
|||||||
module.nvim_set = (
|
module.nvim_set = (
|
||||||
'set shortmess+=IS background=light noswapfile noautoindent'
|
'set shortmess+=IS background=light noswapfile noautoindent'
|
||||||
..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.'
|
..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.'
|
||||||
..' belloff= wildoptions-=pum noshowcmd noruler nomore')
|
..' belloff= wildoptions-=pum noshowcmd noruler nomore redrawdebug=invalid')
|
||||||
module.nvim_argv = {
|
module.nvim_argv = {
|
||||||
module.nvim_prog, '-u', 'NONE', '-i', 'NONE',
|
module.nvim_prog, '-u', 'NONE', '-i', 'NONE',
|
||||||
'--cmd', module.nvim_set, '--embed'}
|
'--cmd', module.nvim_set, '--embed'}
|
||||||
|
Reference in New Issue
Block a user