mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Add copy-mode-position-format to configure the position indicator.
This commit is contained in:
		| @@ -971,6 +971,18 @@ const struct options_table_entry options_table[] = { | ||||
| 	  .text = "Style of the marked line in copy mode." | ||||
| 	}, | ||||
|  | ||||
| 	{ .name = "copy-mode-position-format", | ||||
| 	  .type = OPTIONS_TABLE_STRING, | ||||
| 	  .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, | ||||
| 	  .default_str = "#[align=right]" | ||||
| 	                 "#{t/p:top_line_time}#{?#{e|>:#{top_line_time},0}, ,}" | ||||
| 	                 "[#{scroll_position}/#{history_size}]" | ||||
| 	                 "#{?search_timed_out, (timed out)," | ||||
| 	                 "#{?search_count, (#{search_count}" | ||||
| 	                 "#{?search_count_partial,+,} results),}}", | ||||
| 	  .text = "Format of the position indicator in copy mode." | ||||
| 	}, | ||||
|  | ||||
| 	{ .name = "fill-character", | ||||
| 	  .type = OPTIONS_TABLE_STRING, | ||||
| 	  .scope = OPTIONS_TABLE_WINDOW, | ||||
|   | ||||
| @@ -567,9 +567,11 @@ screen_write_fast_copy(struct screen_write_ctx *ctx, struct screen *src, | ||||
|     u_int px, u_int py, u_int nx, u_int ny) | ||||
| { | ||||
| 	struct screen		*s = ctx->s; | ||||
| 	struct window_pane	*wp = ctx->wp; | ||||
| 	struct tty_ctx	 	 ttyctx; | ||||
| 	struct grid		*gd = src->grid; | ||||
| 	struct grid_cell	 gc; | ||||
| 	u_int		 	 xx, yy, cx, cy; | ||||
| 	u_int		 	 xx, yy, cx = s->cx, cy = s->cy; | ||||
|  | ||||
| 	if (nx == 0 || ny == 0) | ||||
| 		return; | ||||
| @@ -578,18 +580,28 @@ screen_write_fast_copy(struct screen_write_ctx *ctx, struct screen *src, | ||||
| 	for (yy = py; yy < py + ny; yy++) { | ||||
| 		if (yy >= gd->hsize + gd->sy) | ||||
| 			break; | ||||
| 		cx = s->cx; | ||||
| 		s->cx = cx; | ||||
| 		if (wp != NULL) | ||||
| 			screen_write_initctx(ctx, &ttyctx, 0); | ||||
| 		for (xx = px; xx < px + nx; xx++) { | ||||
| 			if (xx >= grid_get_line(gd, yy)->cellsize) | ||||
| 				break; | ||||
| 			grid_get_cell(gd, xx, yy, &gc); | ||||
| 			if (xx + gc.data.width > px + nx) | ||||
| 				break; | ||||
| 			grid_view_set_cell(ctx->s->grid, cx, cy, &gc); | ||||
| 			cx++; | ||||
| 			grid_view_set_cell(ctx->s->grid, s->cx, s->cy, &gc); | ||||
| 			if (wp != NULL) { | ||||
| 				ttyctx.cell = &gc; | ||||
| 				tty_write(tty_cmd_cell, &ttyctx); | ||||
| 				ttyctx.ocx++; | ||||
| 			} | ||||
| 			s->cx++; | ||||
| 		} | ||||
| 		cy++; | ||||
| 		s->cy++; | ||||
| 	} | ||||
|  | ||||
| 	s->cx = cx; | ||||
| 	s->cy = cy; | ||||
| } | ||||
|  | ||||
| /* Select character set for drawing border lines. */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 nicm
					nicm