mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										27
									
								
								input.c
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								input.c
									
									
									
									
									
								
							@@ -1213,6 +1213,10 @@ input_c0_dispatch(struct input_ctx *ictx)
 | 
			
		||||
	struct screen_write_ctx	*sctx = &ictx->ctx;
 | 
			
		||||
	struct window_pane	*wp = ictx->wp;
 | 
			
		||||
	struct screen		*s = sctx->s;
 | 
			
		||||
	struct grid_cell	 gc, first_gc;
 | 
			
		||||
	u_int			 cx = s->cx, line = s->cy + s->grid->hsize;
 | 
			
		||||
	u_int			 width;
 | 
			
		||||
	int			 has_content = 0;
 | 
			
		||||
 | 
			
		||||
	ictx->utf8started = 0; /* can't be valid UTF-8 */
 | 
			
		||||
 | 
			
		||||
@@ -1234,11 +1238,28 @@ input_c0_dispatch(struct input_ctx *ictx)
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
		/* Find the next tab point, or use the last column if none. */
 | 
			
		||||
		grid_get_cell(s->grid, s->cx, line, &first_gc);
 | 
			
		||||
		do {
 | 
			
		||||
			s->cx++;
 | 
			
		||||
			if (bit_test(s->tabs, s->cx))
 | 
			
		||||
			if (!has_content) {
 | 
			
		||||
				grid_get_cell(s->grid, cx, line, &gc);
 | 
			
		||||
				if (gc.data.size != 1 ||
 | 
			
		||||
				    *gc.data.data != ' ' ||
 | 
			
		||||
				    !grid_cells_look_equal(&gc, &first_gc))
 | 
			
		||||
					has_content = 1;
 | 
			
		||||
			}
 | 
			
		||||
			cx++;
 | 
			
		||||
			if (bit_test(s->tabs, cx))
 | 
			
		||||
				break;
 | 
			
		||||
		} while (s->cx < screen_size_x(s) - 1);
 | 
			
		||||
		} while (cx < screen_size_x(s) - 1);
 | 
			
		||||
 | 
			
		||||
		width = cx - s->cx;
 | 
			
		||||
		if (has_content || width > sizeof gc.data.data)
 | 
			
		||||
			s->cx = cx;
 | 
			
		||||
		else {
 | 
			
		||||
			grid_get_cell(s->grid, s->cx, line, &gc);
 | 
			
		||||
			grid_set_tab(&gc, width);
 | 
			
		||||
			screen_write_collect_add(sctx, &gc);
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	case '\012':	/* LF */
 | 
			
		||||
	case '\013':	/* VT */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user