mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Do not consider a selection present if it is empty, from Michael Grant
(GitHub issue 3869). Also a typo fix from GitHub issue 3877.
This commit is contained in:
		
							
								
								
									
										2
									
								
								screen.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								screen.c
									
									
									
									
									
								
							@@ -384,7 +384,7 @@ screen_resize_y(struct screen *s, u_int sy, int eat_empty, u_int *cy)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		/*
 | 
							/*
 | 
				
			||||||
		 * Try to pull as much as possible out of scrolled history, if
 | 
							 * Try to pull as much as possible out of scrolled history, if
 | 
				
			||||||
		 * is is enabled.
 | 
							 * it is enabled.
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		available = gd->hscrolled;
 | 
							available = gd->hscrolled;
 | 
				
			||||||
		if (gd->flags & GRID_HISTORY && available > 0) {
 | 
							if (gd->flags & GRID_HISTORY && available > 0) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -795,16 +795,24 @@ window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft)
 | 
				
			|||||||
	format_add(ft, "copy_cursor_x", "%d", data->cx);
 | 
						format_add(ft, "copy_cursor_x", "%d", data->cx);
 | 
				
			||||||
	format_add(ft, "copy_cursor_y", "%d", data->cy);
 | 
						format_add(ft, "copy_cursor_y", "%d", data->cy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	format_add(ft, "selection_present", "%d", data->screen.sel != NULL);
 | 
					 | 
				
			||||||
	if (data->screen.sel != NULL) {
 | 
						if (data->screen.sel != NULL) {
 | 
				
			||||||
		format_add(ft, "selection_start_x", "%d", data->selx);
 | 
							format_add(ft, "selection_start_x", "%d", data->selx);
 | 
				
			||||||
		format_add(ft, "selection_start_y", "%d", data->sely);
 | 
							format_add(ft, "selection_start_y", "%d", data->sely);
 | 
				
			||||||
		format_add(ft, "selection_end_x", "%d", data->endselx);
 | 
							format_add(ft, "selection_end_x", "%d", data->endselx);
 | 
				
			||||||
		format_add(ft, "selection_end_y", "%d", data->endsely);
 | 
							format_add(ft, "selection_end_y", "%d", data->endsely);
 | 
				
			||||||
		format_add(ft, "selection_active", "%d",
 | 
					
 | 
				
			||||||
		    data->cursordrag != CURSORDRAG_NONE);
 | 
							if (data->cursordrag != CURSORDRAG_NONE)
 | 
				
			||||||
	} else
 | 
								format_add(ft, "selection_active", "1");
 | 
				
			||||||
		format_add(ft, "selection_active", "%d", 0);
 | 
							else
 | 
				
			||||||
 | 
								format_add(ft, "selection_active", "0");
 | 
				
			||||||
 | 
							if (data->endselx != data->selx && data->endsely != data->sely)
 | 
				
			||||||
 | 
								format_add(ft, "selection_present", "1");
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								format_add(ft, "selection_present", "0");
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							format_add(ft, "selection_active", "0");
 | 
				
			||||||
 | 
							format_add(ft, "selection_present", "0");
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	format_add(ft, "search_present", "%d", data->searchmark != NULL);
 | 
						format_add(ft, "search_present", "%d", data->searchmark != NULL);
 | 
				
			||||||
	format_add_cb(ft, "search_match", window_copy_search_match_cb);
 | 
						format_add_cb(ft, "search_match", window_copy_search_match_cb);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user