mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(tui): redraw on SIGWINCH even if size didn't change
(cherry picked from commit 0f1b511f23)
			
			
This commit is contained in:
		 zeertzjq
					zeertzjq
				
			
				
					committed by
					
						![github-actions[bot]](/assets/img/avatar_default.png) github-actions[bot]
						github-actions[bot]
					
				
			
			
				
	
			
			
			![github-actions[bot]](/assets/img/avatar_default.png) github-actions[bot]
						github-actions[bot]
					
				
			
						parent
						
							13d8cca951
						
					
				
				
					commit
					c464df84f7
				
			| @@ -1528,13 +1528,12 @@ void tui_guess_size(TUIData *tui) | |||||||
|     height = DFLT_ROWS; |     height = DFLT_ROWS; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   if (tui->width != width || tui->height != height) { |  | ||||||
|   tui->width = width; |   tui->width = width; | ||||||
|   tui->height = height; |   tui->height = height; | ||||||
|  |  | ||||||
|  |   // Redraw on SIGWINCH event if size didn't change. #23411 | ||||||
|   ui_client_set_size(width, height); |   ui_client_set_size(width, height); | ||||||
| } | } | ||||||
| } |  | ||||||
|  |  | ||||||
| static void unibi_goto(TUIData *tui, int row, int col) | static void unibi_goto(TUIData *tui, int row, int col) | ||||||
| { | { | ||||||
|   | |||||||
| @@ -1565,6 +1565,29 @@ describe('TUI', function() | |||||||
|       {5:-- TERMINAL --}                                    | |       {5:-- TERMINAL --}                                    | | ||||||
|     ]]) |     ]]) | ||||||
|   end) |   end) | ||||||
|  |  | ||||||
|  |   it('redraws on SIGWINCH even if terminal size is unchanged #23411', function() | ||||||
|  |     child_session:request('nvim_echo', {{'foo'}}, false, {}) | ||||||
|  |     screen:expect([[ | ||||||
|  |       {1: }                                                 | | ||||||
|  |       {4:~                                                 }| | ||||||
|  |       {4:~                                                 }| | ||||||
|  |       {4:~                                                 }| | ||||||
|  |       {5:[No Name]                                         }| | ||||||
|  |       foo                                               | | ||||||
|  |       {3:-- TERMINAL --}                                    | | ||||||
|  |     ]]) | ||||||
|  |     exec_lua([[vim.loop.kill(vim.fn.jobpid(vim.bo.channel), 'sigwinch')]]) | ||||||
|  |     screen:expect([[ | ||||||
|  |       {1: }                                                 | | ||||||
|  |       {4:~                                                 }| | ||||||
|  |       {4:~                                                 }| | ||||||
|  |       {4:~                                                 }| | ||||||
|  |       {5:[No Name]                                         }| | ||||||
|  |                                                         | | ||||||
|  |       {3:-- TERMINAL --}                                    | | ||||||
|  |     ]]) | ||||||
|  |   end) | ||||||
| end) | end) | ||||||
|  |  | ||||||
| describe('TUI', function() | describe('TUI', function() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user