mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		| @@ -47,9 +47,7 @@ cmd_clear_history_exec(struct cmd *self, struct cmd_q *cmdq) | |||||||
|  |  | ||||||
| 	if (wp->mode == &window_copy_mode) | 	if (wp->mode == &window_copy_mode) | ||||||
| 		window_pane_reset_mode(wp); | 		window_pane_reset_mode(wp); | ||||||
|  | 	grid_clear_history(gd); | ||||||
| 	grid_move_lines(gd, 0, gd->hsize, gd->sy); |  | ||||||
| 	gd->hsize = 0; |  | ||||||
|  |  | ||||||
| 	return (CMD_RETURN_NORMAL); | 	return (CMD_RETURN_NORMAL); | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										20
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								grid.c
									
									
									
									
									
								
							| @@ -170,6 +170,18 @@ grid_scroll_history(struct grid *gd) | |||||||
| 	gd->hsize++; | 	gd->hsize++; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | /* Clear the history. */ | ||||||
|  | void | ||||||
|  | grid_clear_history(struct grid *gd) | ||||||
|  | { | ||||||
|  | 	grid_clear_lines(gd, 0, gd->hsize); | ||||||
|  | 	grid_move_lines(gd, 0, gd->hsize, gd->sy); | ||||||
|  |  | ||||||
|  | 	gd->hsize = 0; | ||||||
|  | 	gd->linedata = xreallocarray(gd->linedata, gd->sy, | ||||||
|  | 	    sizeof *gd->linedata); | ||||||
|  | } | ||||||
|  |  | ||||||
| /* Scroll a region up, moving the top line into the history. */ | /* Scroll a region up, moving the top line into the history. */ | ||||||
| void | void | ||||||
| grid_scroll_history_region(struct grid *gd, u_int upper, u_int lower) | grid_scroll_history_region(struct grid *gd, u_int upper, u_int lower) | ||||||
| @@ -344,8 +356,8 @@ grid_move_lines(struct grid *gd, u_int dy, u_int py, u_int ny) | |||||||
| 		grid_clear_lines(gd, yy, 1); | 		grid_clear_lines(gd, yy, 1); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	memmove( | 	memmove(&gd->linedata[dy], &gd->linedata[py], | ||||||
| 	    &gd->linedata[dy], &gd->linedata[py], ny * (sizeof *gd->linedata)); | 	    ny * (sizeof *gd->linedata)); | ||||||
|  |  | ||||||
| 	/* Wipe any lines that have been moved (without freeing them). */ | 	/* Wipe any lines that have been moved (without freeing them). */ | ||||||
| 	for (yy = py; yy < py + ny; yy++) { | 	for (yy = py; yy < py + ny; yy++) { | ||||||
| @@ -371,8 +383,8 @@ grid_move_cells(struct grid *gd, u_int dx, u_int px, u_int py, u_int nx) | |||||||
|  |  | ||||||
| 	grid_expand_line(gd, py, px + nx); | 	grid_expand_line(gd, py, px + nx); | ||||||
| 	grid_expand_line(gd, py, dx + nx); | 	grid_expand_line(gd, py, dx + nx); | ||||||
| 	memmove( | 	memmove(&gl->celldata[dx], &gl->celldata[px], | ||||||
| 	    &gl->celldata[dx], &gl->celldata[px], nx * sizeof *gl->celldata); | 	    nx * sizeof *gl->celldata); | ||||||
|  |  | ||||||
| 	/* Wipe any cells that have been moved. */ | 	/* Wipe any cells that have been moved. */ | ||||||
| 	for (xx = px; xx < px + nx; xx++) { | 	for (xx = px; xx < px + nx; xx++) { | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							| @@ -1843,6 +1843,7 @@ int	 grid_compare(struct grid *, struct grid *); | |||||||
| void	 grid_collect_history(struct grid *); | void	 grid_collect_history(struct grid *); | ||||||
| void	 grid_scroll_history(struct grid *); | void	 grid_scroll_history(struct grid *); | ||||||
| void	 grid_scroll_history_region(struct grid *, u_int, u_int); | void	 grid_scroll_history_region(struct grid *, u_int, u_int); | ||||||
|  | void	 grid_clear_history(struct grid *); | ||||||
| void	 grid_expand_line(struct grid *, u_int, u_int); | void	 grid_expand_line(struct grid *, u_int, u_int); | ||||||
| const struct grid_cell *grid_peek_cell(struct grid *, u_int, u_int); | const struct grid_cell *grid_peek_cell(struct grid *, u_int, u_int); | ||||||
| const struct grid_line *grid_peek_line(struct grid *, u_int); | const struct grid_line *grid_peek_line(struct grid *, u_int); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Thomas Adam
					Thomas Adam