1 diff -urNp -x '*.orig' xchat-2.8.8.org/src/fe-gtk/xtext.c xchat-2.8.8/src/fe-gtk/xtext.c
2 --- xchat-2.8.8.org/src/fe-gtk/xtext.c 2021-05-07 23:46:39.862941602 +0200
3 +++ xchat-2.8.8/src/fe-gtk/xtext.c 2021-05-07 23:46:40.166281587 +0200
9 - (c == ' ' || c == '\n' || c == ')' || c == '(' || \
10 - c == '>' || c == '<' || c == ATTR_RESET || c == ATTR_BOLD || c == 0)
11 +int is_del(const char *c) {
14 + ret = (c[0] == ' ' || c[0] == '\n' || c[0] == ')' || c[0] == '(' ||
15 + c[0] == '>' || c[0] == '<' || c[0] == ATTR_RESET || c[0] == ATTR_BOLD || c == 0);
17 + ret = strncmp(c, "“", 3) == 0 || strncmp(c, "”", 3) == 0;
23 /* force scrolling off */
24 @@ -1836,6 +1843,7 @@ gtk_xtext_get_word (GtkXText * xtext, in
28 + unsigned char *nstr;
30 int out_of_bounds = 0;
32 @@ -1856,16 +1864,17 @@ gtk_xtext_get_word (GtkXText * xtext, in
34 str = ent->str + offset;
36 - while (!is_del (*str) && str != ent->str)
39 + while (!is_del(str))
40 + str = g_utf8_prev_char(str);
41 + word = g_utf8_next_char(str);
45 - while (!is_del (*str) && len != ent->str_len)
46 + while (!is_del(str) && len != ent->str_len)
50 + nstr = g_utf8_next_char(str);
55 /* ignore trailing dots and commas. */
56 @@ -3976,7 +3985,7 @@ find_next_wrap (GtkXText * xtext, texten
59 /* keep a record of the last space, for wordwrapping */
61 + if (g_unichar_isspace(g_utf8_get_char(str)))