summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libvterm/src/screen.c7
-rw-r--r--src/testdir/test_terminal.vim15
-rw-r--r--src/version.c2
3 files changed, 23 insertions, 1 deletions
diff --git a/src/libvterm/src/screen.c b/src/libvterm/src/screen.c
index eb90c2007..42890aa58 100644
--- a/src/libvterm/src/screen.c
+++ b/src/libvterm/src/screen.c
@@ -186,7 +186,12 @@ static int putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
cell->chars[i] = 0;
for(col = 1; col < info->width; col++)
- getcell(screen, pos.row, pos.col + col)->chars[0] = (uint32_t)-1;
+ {
+ ScreenCell *onecell = getcell(screen, pos.row, pos.col + col);
+ if (onecell == NULL)
+ break;
+ onecell->chars[0] = (uint32_t)-1;
+ }
rect.start_row = pos.row;
rect.end_row = pos.row+1;
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index fcc11565c..c1ee493cd 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -258,6 +258,21 @@ func Test_terminal_scrape_multibyte()
call delete('Xtext')
endfunc
+func Test_terminal_one_column()
+ " This creates a terminal, displays a double-wide character and makes the
+ " window one column wide. This used to cause a crash.
+ let width = &columns
+ botright vert term
+ let buf = bufnr('$')
+ call term_wait(buf, 100)
+ exe "set columns=" .. (width / 2)
+ redraw
+ call term_sendkeys(buf, "キ")
+ call term_wait(buf, 10)
+ exe "set columns=" .. width
+ exe buf . 'bwipe!'
+endfunc
+
func Test_terminal_scroll()
call writefile(range(1, 200), 'Xtext')
if has('win32')
diff --git a/src/version.c b/src/version.c
index 70d90c576..f34402dc6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1353,
+/**/
1352,
/**/
1351,