mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(messages): ensure msg_grid is at top at more prompt (#23584)
This commit is contained in:
		| @@ -181,7 +181,7 @@ void msg_grid_validate(void) | |||||||
|     msg_grid.dirty_col = xcalloc((size_t)Rows, sizeof(*msg_grid.dirty_col)); |     msg_grid.dirty_col = xcalloc((size_t)Rows, sizeof(*msg_grid.dirty_col)); | ||||||
|  |  | ||||||
|     // Tricky: allow resize while pager or ex mode is active |     // Tricky: allow resize while pager or ex mode is active | ||||||
|     int pos = MAX(max_rows - msg_scrolled, 0); |     int pos = (State & MODE_ASKMORE) ? 0 : MAX(max_rows - msg_scrolled, 0); | ||||||
|     msg_grid.throttled = false;  // don't throttle in 'cmdheight' area |     msg_grid.throttled = false;  // don't throttle in 'cmdheight' area | ||||||
|     msg_grid_set_pos(pos, msg_scrolled); |     msg_grid_set_pos(pos, msg_scrolled); | ||||||
|     ui_comp_put_grid(&msg_grid, pos, 0, msg_grid.rows, msg_grid.cols, |     ui_comp_put_grid(&msg_grid, pos, 0, msg_grid.rows, msg_grid.cols, | ||||||
|   | |||||||
| @@ -112,7 +112,7 @@ describe('TUI', function() | |||||||
|     child_session:request("nvim_exec", [[ |     child_session:request("nvim_exec", [[ | ||||||
|     set more |     set more | ||||||
|     func! ManyErr() |     func! ManyErr() | ||||||
|       for i in range(10) |       for i in range(20) | ||||||
|         echoerr "FAIL ".i |         echoerr "FAIL ".i | ||||||
|       endfor |       endfor | ||||||
|     endfunc |     endfunc | ||||||
| @@ -128,7 +128,35 @@ describe('TUI', function() | |||||||
|       {3:-- TERMINAL --}                                    | |       {3:-- TERMINAL --}                                    | | ||||||
|     ]]} |     ]]} | ||||||
|  |  | ||||||
|     feed_data('d') |     screen:try_resize(50,10) | ||||||
|  |     screen:expect{grid=[[ | ||||||
|  |       :call ManyErr()                                   | | ||||||
|  |       {8:Error detected while processing function ManyErr:} | | ||||||
|  |       {11:line    2:}                                        | | ||||||
|  |       {8:FAIL 0}                                            | | ||||||
|  |       {8:FAIL 1}                                            | | ||||||
|  |       {8:FAIL 2}                                            | | ||||||
|  |                                                         | | ||||||
|  |                                                         | | ||||||
|  |       {10:-- More --}{1: }                                       | | ||||||
|  |       {3:-- TERMINAL --}                                    | | ||||||
|  |     ]]} | ||||||
|  |  | ||||||
|  |     feed_data('j') | ||||||
|  |     screen:expect{grid=[[ | ||||||
|  |       {8:Error detected while processing function ManyErr:} | | ||||||
|  |       {11:line    2:}                                        | | ||||||
|  |       {8:FAIL 0}                                            | | ||||||
|  |       {8:FAIL 1}                                            | | ||||||
|  |       {8:FAIL 2}                                            | | ||||||
|  |       {8:FAIL 3}                                            | | ||||||
|  |       {8:FAIL 4}                                            | | ||||||
|  |       {8:FAIL 5}                                            | | ||||||
|  |       {10:-- More --}{1: }                                       | | ||||||
|  |       {3:-- TERMINAL --}                                    | | ||||||
|  |     ]]} | ||||||
|  |  | ||||||
|  |     screen:try_resize(50,7) | ||||||
|     screen:expect{grid=[[ |     screen:expect{grid=[[ | ||||||
|       {8:FAIL 1}                                            | |       {8:FAIL 1}                                            | | ||||||
|       {8:FAIL 2}                                            | |       {8:FAIL 2}                                            | | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 zeertzjq
					zeertzjq