mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Use the existing code in format.c to add foramts for word and line at
cursor position in copy mode, from Anindya Mukherjee.
This commit is contained in:
		@@ -564,6 +564,7 @@ static void
 | 
			
		||||
window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft)
 | 
			
		||||
{
 | 
			
		||||
	struct window_copy_mode_data	*data = wme->data;
 | 
			
		||||
	char				*s;
 | 
			
		||||
 | 
			
		||||
	format_add(ft, "scroll_position", "%d", data->oy);
 | 
			
		||||
	format_add(ft, "rectangle_toggle", "%d", data->rectflag);
 | 
			
		||||
@@ -578,6 +579,18 @@ window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft)
 | 
			
		||||
		format_add(ft, "selection_end_x", "%d", data->endselx);
 | 
			
		||||
		format_add(ft, "selection_end_y", "%d", data->endsely);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	s = format_grid_word(data->screen.grid, data->cx, data->cy);
 | 
			
		||||
	if (s != NULL) {
 | 
			
		||||
		format_add(ft, "copy_cursor_word", "%s", s);
 | 
			
		||||
		free(s);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	s = format_grid_line(data->screen.grid, data->cy);
 | 
			
		||||
	if (s != NULL) {
 | 
			
		||||
		format_add(ft, "copy_cursor_line", "%s", s);
 | 
			
		||||
		free(s);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user