diff src/testdir/test_cmdwin.vim @ 30525:6fa498af368d v9.0.0598

patch 9.0.0598: using negative array index with negative width window Commit: https://github.com/vim/vim/commit/8279af514ca7e5fd3c31cf13b0864163d1a0bfeb Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 26 23:08:22 2022 +0100 patch 9.0.0598: using negative array index with negative width window Problem: Using negative array index with negative width window. Solution: Make sure the window width does not become negative.
author Bram Moolenaar <Bram@vim.org>
date Tue, 27 Sep 2022 00:15:06 +0200
parents 8496a2c45962
children ac908e454519
line wrap: on
line diff
--- a/src/testdir/test_cmdwin.vim
+++ b/src/testdir/test_cmdwin.vim
@@ -404,5 +404,27 @@ func Test_cmdwin_freed_buffer_ptr()
   bwipe!
 endfunc
 
+" This was resulting in a window with negative width.
+" The test doesn't reproduce the illegal memory access though...
+func Test_cmdwin_split_often()
+  let lines = &lines
+  let columns = &columns
+  set t_WS=
+
+  try
+    set encoding=iso8859
+    set ruler
+    winsize 0 0
+    noremap 0 H
+    sil norm 0000000q:
+  catch /E36:/
+  endtry
+
+  bwipe!
+  set encoding=utf8
+  let &lines = lines
+  let &columns = columns
+endfunc
+
 
 " vim: shiftwidth=2 sts=2 expandtab