From 5db389da21ce2d4132f4416545da4f8a50217109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 26 Jan 2021 20:26:34 +0100 Subject: [PATCH] search: match composed characters when extending the search string to the next word boundary --- search.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/search.c b/search.c index 0b498c17..b173f694 100644 --- a/search.c +++ b/search.c @@ -472,6 +472,14 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only) if (wc == CELL_MULT_COL_SPACER) continue; + const struct composed *composed = NULL; + if (wc >= CELL_COMB_CHARS_LO && + wc < (CELL_COMB_CHARS_LO + term->composed_count)) + { + composed = &term->composed[wc - CELL_COMB_CHARS_LO]; + wc = composed->base; + } + if (wc == 0 || (!first && !isword(wc, spaces_only, term->conf->word_delimiters))) { done = true; break; @@ -479,6 +487,11 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only) first = false; tll_push_back(new_chars, wc); + + if (composed != NULL) { + for (size_t i = 0; i < composed->count; i++) + tll_push_back(new_chars, composed->combining[i]); + } } if (done)