mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(getchar): flush screen before doing a blocking wait
This commit is contained in:
		| @@ -2722,6 +2722,8 @@ static void getchar_common(typval_T *argvars, typval_T *rettv) | |||||||
|       // getchar(): blocking wait. |       // getchar(): blocking wait. | ||||||
|       // TODO(bfredl): deduplicate shared logic with state_enter ? |       // TODO(bfredl): deduplicate shared logic with state_enter ? | ||||||
|       if (!char_avail()) { |       if (!char_avail()) { | ||||||
|  |         // flush output before waiting | ||||||
|  |         ui_flush(); | ||||||
|         (void)os_inchar(NULL, 0, -1, 0, main_loop.events); |         (void)os_inchar(NULL, 0, -1, 0, main_loop.events); | ||||||
|         if (!multiqueue_empty(main_loop.events)) { |         if (!multiqueue_empty(main_loop.events)) { | ||||||
|           state_handle_k_event(); |           state_handle_k_event(); | ||||||
|   | |||||||
| @@ -1243,6 +1243,19 @@ vimComment     xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1  excludenl contains=@vim | |||||||
|                                                                   | |                                                                   | | ||||||
|     ]]) |     ]]) | ||||||
|   end) |   end) | ||||||
|  |  | ||||||
|  |   it('echo messages are shown correctly when getchar() immediately follows', function() | ||||||
|  |     feed([[:echo 'foo' | echo 'bar' | call getchar()<CR>]]) | ||||||
|  |     screen:expect([[ | ||||||
|  |                                                                   | | ||||||
|  |       {1:~                                                           }| | ||||||
|  |       {1:~                                                           }| | ||||||
|  |       {1:~                                                           }| | ||||||
|  |       {3:                                                            }| | ||||||
|  |       foo                                                         | | ||||||
|  |       bar^                                                         | | ||||||
|  |     ]]) | ||||||
|  |   end) | ||||||
| end) | end) | ||||||
|  |  | ||||||
| describe('ui/ext_messages', function() | describe('ui/ext_messages', function() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 zeertzjq
					zeertzjq