Commit Diff


commit - 55b0b0368a5ff57aee3778d816a2bd2a2d6a745d
commit + 218ac7f60aef50ad9efd0a267a634baebdb9ddf2
blob - 70975cbd212b49ba2cc9867408a524662782caa8
blob + 6bec90ed882d8c0ef15417ec3dea941c0b1f127c
--- wrap.c
+++ wrap.c
@@ -137,7 +137,7 @@ int
 wrap_text(struct buffer *buffer, const char *prfx, struct line *l, size_t width)
 {
 	const char	*separators = " \t-";
-	const char	*start, *end, *line, *lastsep, *lastchar;
+	const char	*start, *end, *line, *lastsep, *lastchar, *space;
 	uint32_t	 cp = 0, state = 0;
 	size_t		 cur, prfxwidth, w;
 	int		 flags;
@@ -151,6 +151,14 @@ wrap_text(struct buffer *buffer, const char *prfx, str
 	lastsep = NULL;
 	lastchar = line;
 	flags = 0;
+
+	if (l->type == LINE_LINK && emojify_link &&
+	    emojied_line(l->line, &space)) {
+		prfxwidth = utf8_swidth_between(l->line, space);
+		cur = prfxwidth;
+		line = space + 1;
+	}
+
 	for (; *line; line++) {
 		if (utf8_decode(&state, &cp, *line))
 			continue;