mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Add formats for word and line under the mouse and use them to add some
items to the pane menu.
This commit is contained in:
		
							
								
								
									
										20
									
								
								utf8.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								utf8.c
									
									
									
									
									
								
							@@ -410,3 +410,23 @@ utf8_padcstr(const char *s, u_int width)
 | 
			
		||||
	out[slen] = '\0';
 | 
			
		||||
	return (out);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
utf8_cstrhas(const char *s, const struct utf8_data *ud)
 | 
			
		||||
{
 | 
			
		||||
	struct utf8_data	*copy, *loop;
 | 
			
		||||
	int			 found = 0;
 | 
			
		||||
 | 
			
		||||
	copy = utf8_fromcstr(s);
 | 
			
		||||
	for (loop = copy; loop->size != 0; loop++) {
 | 
			
		||||
		if (loop->size != ud->size)
 | 
			
		||||
			continue;
 | 
			
		||||
		if (memcmp(loop->data, ud->data, loop->size) == 0) {
 | 
			
		||||
			found = 1;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	free(copy);
 | 
			
		||||
 | 
			
		||||
	return (found);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user