Repository: neovim/neovim
File: test/functional/ui/screen_basic_spec.lua (Lua)

Code before:
      feed('<CR>')
      screen:expect([[
        ^                    |
        {0:~                   }|*12
                            |
      ]])
      feed(':set columns=0<CR>')
      screen:expect([[
                            |
        {0:~                   }|*7
        {1:                    }|
        {8:E594: Need at least }|
        {8:12 columns: columns=}|
        {8:0}                   |
        {7:Press ENTER or type }|
        {7:command to continue}^ |
      ]])
      feed('<CR>')
      screen:expect([[
        ^                    |
        {0:~                   }|*12
                            |
      ]])
    end)

    it('does not crash Neovim #33883', function()
      screen:try_resize(80, 20)
      while true do
        local ok = pcall(command, 'wincmd v')
        if not ok then
          break
        end
      end

      screen:try_resize(60, 20)

      assert_alive()
    end)

    it('clamps &cmdheight for current tabpage', function()
      command('set cmdheight=10 laststatus=2')
      screen:expect([[
        ^                                                     |
        {0:~                                                    }|*2
        {1:[No Name]                                            }|
                                                             |*10
      ]])
      screen:try_resize(53, 8)
      screen:expect([[
        ^                                                     |
        {1:[No Name]                                            }|

Review comment (bug):
```suggestion
    it('does not crash when windows fill the screen #33883', function()
```

Code after:
      feed('<CR>')
      screen:expect([[
        ^                    |
        {0:~                   }|*12
                            |
      ]])
      feed(':set columns=0<CR>')
      screen:expect([[
                            |
        {0:~                   }|*7
        {1:                    }|
        {8:E594: Need at least }|
        {8:12 columns: columns=}|
        {8:0}                   |
        {7:Press ENTER or type }|
        {7:command to continue}^ |
      ]])
      feed('<CR>')
      screen:expect([[
        ^                    |
        {0:~                   }|*12
                            |
      ]])
    end)

    it('does not crash when windows fill the screen #33883', function()
      screen:try_resize(80, 20)
      while true do
        local ok = pcall(command, 'wincmd v')
        if not ok then
          break
        end
      end

      screen:try_resize(60, 20)

      assert_alive()
    end)

    it('clamps &cmdheight for current tabpage', function()
      command('set cmdheight=10 laststatus=2')
      screen:expect([[
        ^                                                     |
        {0:~                                                    }|*2
        {1:[No Name]                                            }|
                                                             |*10
      ]])
      screen:try_resize(53, 8)
      screen:expect([[
        ^                                                     |
        {1:[No Name]                                            }|