mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	tui: Only enable/disable mouse when there's something to do (#6411)
If we get a mouse_on/mouse_off event, but the mouse is already in the corresponding state, there's no need to send the event up to the terminal. Closes #4394
This commit is contained in:
		 James McCoy
					James McCoy
				
			
				
					committed by
					
						 Justin M. Keyes
						Justin M. Keyes
					
				
			
			
				
	
			
			
			 Justin M. Keyes
						Justin M. Keyes
					
				
			
						parent
						
							518f28f537
						
					
				
				
					commit
					16babc6687
				
			| @@ -452,15 +452,19 @@ static void tui_busy_stop(UI *ui) | |||||||
| static void tui_mouse_on(UI *ui) | static void tui_mouse_on(UI *ui) | ||||||
| { | { | ||||||
|   TUIData *data = ui->data; |   TUIData *data = ui->data; | ||||||
|  |   if (!data->mouse_enabled) { | ||||||
|     unibi_out(ui, data->unibi_ext.enable_mouse); |     unibi_out(ui, data->unibi_ext.enable_mouse); | ||||||
|     data->mouse_enabled = true; |     data->mouse_enabled = true; | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| static void tui_mouse_off(UI *ui) | static void tui_mouse_off(UI *ui) | ||||||
| { | { | ||||||
|   TUIData *data = ui->data; |   TUIData *data = ui->data; | ||||||
|  |   if (data->mouse_enabled) { | ||||||
|     unibi_out(ui, data->unibi_ext.disable_mouse); |     unibi_out(ui, data->unibi_ext.disable_mouse); | ||||||
|     data->mouse_enabled = false; |     data->mouse_enabled = false; | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| static void tui_mode_change(UI *ui, int mode) | static void tui_mode_change(UI *ui, int mode) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user