mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	terminal: refresh before on_exit. #5217
References #3030 References https://github.com/radenling/vim-dispatch-neovim/issues/6 The terminal is updated by a timer, but on_exit needs the final state. Before this change, on_exit callback could see a stale terminal buffer. Helped-by: oni-link <knil.ino@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						Justin M. Keyes
					
				
			
			
				
	
			
			
			
						parent
						
							a9605bb4af
						
					
				
				
					commit
					a6f74debc0
				
			@@ -302,8 +302,16 @@ void terminal_close(Terminal *term, char *msg)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  term->forward_mouse = false;
 | 
			
		||||
  term->closed = true;
 | 
			
		||||
 | 
			
		||||
  // flush any pending changes to the buffer
 | 
			
		||||
  if (!exiting) {
 | 
			
		||||
    block_autocmds();
 | 
			
		||||
    refresh_terminal(term);
 | 
			
		||||
    unblock_autocmds();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  buf_T *buf = handle_get_buffer(term->buf_handle);
 | 
			
		||||
  term->closed = true;
 | 
			
		||||
 | 
			
		||||
  if (!msg || exiting) {
 | 
			
		||||
    // If no msg was given, this was called by close_buffer(buffer.c).  Or if
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user