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:
		| @@ -85,12 +85,18 @@ cmd_run_shell_print(struct job *job, const char *msg) | |||||||
|  |  | ||||||
| 	if (cdata->wp_id != -1) | 	if (cdata->wp_id != -1) | ||||||
| 		wp = window_pane_find_by_id(cdata->wp_id); | 		wp = window_pane_find_by_id(cdata->wp_id); | ||||||
| 	if (wp == NULL && cdata->item != NULL && cdata->client != NULL) | 	if (wp == NULL) { | ||||||
|  | 		if (cdata->item != NULL) { | ||||||
|  | 			cmdq_print(cdata->item, "%s", msg); | ||||||
|  | 			return; | ||||||
|  | 		} | ||||||
|  | 		if (cdata->item != NULL && cdata->client != NULL) | ||||||
| 			wp = server_client_get_pane(cdata->client); | 			wp = server_client_get_pane(cdata->client); | ||||||
| 		if (wp == NULL && cmd_find_from_nothing(&fs, 0) == 0) | 		if (wp == NULL && cmd_find_from_nothing(&fs, 0) == 0) | ||||||
| 			wp = fs.wp; | 			wp = fs.wp; | ||||||
| 		if (wp == NULL) | 		if (wp == NULL) | ||||||
| 			return; | 			return; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	wme = TAILQ_FIRST(&wp->modes); | 	wme = TAILQ_FIRST(&wp->modes); | ||||||
| 	if (wme == NULL || wme->mode != &window_view_mode) | 	if (wme == NULL || wme->mode != &window_view_mode) | ||||||
|   | |||||||
| @@ -383,6 +383,14 @@ const struct options_table_entry options_table[] = { | |||||||
| 	  .text = "Maximum number of commands to keep in history." | 	  .text = "Maximum number of commands to keep in history." | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
|  | 	{ .name = "search-wrapped-lines", | ||||||
|  | 	  .type = OPTIONS_TABLE_FLAG, | ||||||
|  | 	  .scope = OPTIONS_TABLE_SERVER, | ||||||
|  | 	  .default_num = 1, | ||||||
|  | 	  .text = "Whether to include full wrapped lines when searching for " | ||||||
|  | 		  "text in copy mode." | ||||||
|  | 	}, | ||||||
|  |  | ||||||
| 	{ .name = "set-clipboard", | 	{ .name = "set-clipboard", | ||||||
| 	  .type = OPTIONS_TABLE_CHOICE, | 	  .type = OPTIONS_TABLE_CHOICE, | ||||||
| 	  .scope = OPTIONS_TABLE_SERVER, | 	  .scope = OPTIONS_TABLE_SERVER, | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								tmux.1
									
									
									
									
									
								
							| @@ -3797,6 +3797,14 @@ each client. | |||||||
| .It Ic prompt-history-limit Ar number | .It Ic prompt-history-limit Ar number | ||||||
| Set the number of history items to save in the history file for each type of | Set the number of history items to save in the history file for each type of | ||||||
| command prompt. | command prompt. | ||||||
|  | .It Xo Ic search-wrapped-lines | ||||||
|  | .Op Ic on | off | ||||||
|  | .Xc | ||||||
|  | Defines how | ||||||
|  | .Nm | ||||||
|  | handles wrapped lines when searching in copy mode. | ||||||
|  | When disabled, lines are truncated and searching is faster, but matches may be | ||||||
|  | missed. | ||||||
| .It Xo Ic set-clipboard | .It Xo Ic set-clipboard | ||||||
| .Op Ic on | external | off | .Op Ic on | external | off | ||||||
| .Xc | .Xc | ||||||
|   | |||||||
| @@ -3615,11 +3615,13 @@ window_copy_search_jump(struct window_mode_entry *wme, struct grid *gd, | |||||||
|     int direction, int regex) |     int direction, int regex) | ||||||
| { | { | ||||||
| 	u_int			 i, px, sx, ssize = 1; | 	u_int			 i, px, sx, ssize = 1; | ||||||
| 	int			 found = 0, cflags = REG_EXTENDED; | 	int			 wrapped, found = 0, cflags = REG_EXTENDED; | ||||||
| 	char			*sbuf; | 	char			*sbuf; | ||||||
| 	regex_t			 reg; | 	regex_t			 reg; | ||||||
| 	struct grid_line	*gl; | 	struct grid_line	*gl; | ||||||
|  |  | ||||||
|  | 	wrapped = options_get_number(global_options, "search-wrapped-lines"); | ||||||
|  |  | ||||||
| 	if (regex) { | 	if (regex) { | ||||||
| 		sbuf = xmalloc(ssize); | 		sbuf = xmalloc(ssize); | ||||||
| 		sbuf[0] = '\0'; | 		sbuf[0] = '\0'; | ||||||
| @@ -3636,7 +3638,9 @@ window_copy_search_jump(struct window_mode_entry *wme, struct grid *gd, | |||||||
| 	if (direction) { | 	if (direction) { | ||||||
| 		for (i = fy; i <= endline; i++) { | 		for (i = fy; i <= endline; i++) { | ||||||
| 			gl = grid_get_line(gd, i); | 			gl = grid_get_line(gd, i); | ||||||
| 			if (i != endline && gl->flags & GRID_LINE_WRAPPED) | 			if (!wrapped && | ||||||
|  | 			    i != endline && | ||||||
|  | 			    gl->flags & GRID_LINE_WRAPPED) | ||||||
| 				continue; | 				continue; | ||||||
| 			if (regex) { | 			if (regex) { | ||||||
| 				found = window_copy_search_lr_regex(gd, | 				found = window_copy_search_lr_regex(gd, | ||||||
| @@ -3652,7 +3656,9 @@ window_copy_search_jump(struct window_mode_entry *wme, struct grid *gd, | |||||||
| 	} else { | 	} else { | ||||||
| 		for (i = fy + 1; endline < i; i--) { | 		for (i = fy + 1; endline < i; i--) { | ||||||
| 			gl = grid_get_line(gd, i - 1); | 			gl = grid_get_line(gd, i - 1); | ||||||
| 			if (i != endline && gl->flags & GRID_LINE_WRAPPED) | 			if (!wrapped && | ||||||
|  | 			    i != endline && | ||||||
|  | 			    gl->flags & GRID_LINE_WRAPPED) | ||||||
| 				continue; | 				continue; | ||||||
| 			if (regex) { | 			if (regex) { | ||||||
| 				found = window_copy_search_rl_regex(gd, | 				found = window_copy_search_rl_regex(gd, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Thomas Adam
					Thomas Adam