mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Break cursor movement in grid into a common set of functions that can
handle line wrapping and so on in one place and use them for the obvious copy mode commands. From Anindya Mukherjee.
This commit is contained in:
		
							
								
								
									
										23
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								tmux.h
									
									
									
									
									
								
							@@ -726,6 +726,13 @@ struct grid {
 | 
			
		||||
	struct grid_line	*linedata;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Virtual cursor in a grid. */
 | 
			
		||||
struct grid_reader {
 | 
			
		||||
	struct grid	*gd;
 | 
			
		||||
	u_int		 cx;
 | 
			
		||||
	u_int		 cy;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Style alignment. */
 | 
			
		||||
enum style_align {
 | 
			
		||||
	STYLE_ALIGN_DEFAULT,
 | 
			
		||||
@@ -2548,6 +2555,22 @@ void	 grid_wrap_position(struct grid *, u_int, u_int, u_int *, u_int *);
 | 
			
		||||
void	 grid_unwrap_position(struct grid *, u_int *, u_int *, u_int, u_int);
 | 
			
		||||
u_int	 grid_line_length(struct grid *, u_int);
 | 
			
		||||
 | 
			
		||||
/* grid-reader.c */
 | 
			
		||||
void	 grid_reader_start(struct grid_reader *, struct grid *, u_int, u_int);
 | 
			
		||||
void	 grid_reader_get_cursor(struct grid_reader *, u_int *, u_int *);
 | 
			
		||||
u_int	 grid_reader_line_length(struct grid_reader *);
 | 
			
		||||
int	 grid_reader_in_set(struct grid_reader *, const char *);
 | 
			
		||||
void	 grid_reader_cursor_right(struct grid_reader *, int, int);
 | 
			
		||||
void	 grid_reader_cursor_left(struct grid_reader *);
 | 
			
		||||
void	 grid_reader_cursor_down(struct grid_reader *);
 | 
			
		||||
void	 grid_reader_cursor_up(struct grid_reader *);
 | 
			
		||||
void	 grid_reader_cursor_start_of_line(struct grid_reader *, int);
 | 
			
		||||
void	 grid_reader_cursor_end_of_line(struct grid_reader *, int, int);
 | 
			
		||||
void	 grid_reader_cursor_next_word(struct grid_reader *, const char *);
 | 
			
		||||
void	 grid_reader_cursor_next_word_end(struct grid_reader *, const char *);
 | 
			
		||||
void	 grid_reader_cursor_previous_word(struct grid_reader *, const char *,
 | 
			
		||||
	     int);
 | 
			
		||||
 | 
			
		||||
/* grid-view.c */
 | 
			
		||||
void	 grid_view_get_cell(struct grid *, u_int, u_int, struct grid_cell *);
 | 
			
		||||
void	 grid_view_set_cell(struct grid *, u_int, u_int,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user