mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	Merge pull request #23562 from neovim/backport-23428-to-release-0.9
[Backport release-0.9] fix(tui): grid_clear properly clears the screen
This commit is contained in:
		@@ -977,7 +977,7 @@ void tui_grid_clear(TUIData *tui, Integer g)
 | 
			
		||||
  UGrid *grid = &tui->grid;
 | 
			
		||||
  ugrid_clear(grid);
 | 
			
		||||
  kv_size(tui->invalid_regions) = 0;
 | 
			
		||||
  clear_region(tui, 0, grid->height, 0, grid->width, 0);
 | 
			
		||||
  clear_region(tui, 0, tui->height, 0, tui->width, 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void tui_grid_cursor_goto(TUIData *tui, Integer grid, Integer row, Integer col)
 | 
			
		||||
 
 | 
			
		||||
@@ -66,10 +66,10 @@ describe('api', function()
 | 
			
		||||
 | 
			
		||||
    screen:expect([[
 | 
			
		||||
      [tui] insert-mode                                 |
 | 
			
		||||
      [socket 1] this is more t{4:                         }|
 | 
			
		||||
      han 25 columns           {4:                         }|
 | 
			
		||||
      [socket 2] input{1: }        {4:                         }|
 | 
			
		||||
      {4:~                                                 }|
 | 
			
		||||
      [socket 1] this is more t                         |
 | 
			
		||||
      han 25 columns                                    |
 | 
			
		||||
      [socket 2] input{1: }                                 |
 | 
			
		||||
      {4:~                        }                         |
 | 
			
		||||
      {3:-- INSERT --}                                      |
 | 
			
		||||
      {3:-- TERMINAL --}                                    |
 | 
			
		||||
    ]])
 | 
			
		||||
 
 | 
			
		||||
@@ -2445,6 +2445,19 @@ describe("TUI as a client", function()
 | 
			
		||||
      {3:-- TERMINAL --}                                    |
 | 
			
		||||
    ]]}
 | 
			
		||||
 | 
			
		||||
    -- grid smaller than containing terminal window is cleared properly
 | 
			
		||||
    feed_data(":call setline(1,['a'->repeat(&columns)]->repeat(&lines))\n")
 | 
			
		||||
    feed_data("0:set lines=2\n")
 | 
			
		||||
    screen_server:expect{grid=[[
 | 
			
		||||
      {1:a}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
 | 
			
		||||
      {5:[No Name] [+]                                     }|
 | 
			
		||||
                                                        |
 | 
			
		||||
                                                        |
 | 
			
		||||
                                                        |
 | 
			
		||||
                                                        |
 | 
			
		||||
      {3:-- TERMINAL --}                                    |
 | 
			
		||||
    ]]}
 | 
			
		||||
 | 
			
		||||
    feed_data(":q!\n")
 | 
			
		||||
 | 
			
		||||
    server_super:close()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user