diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-26 19:31:16 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-26 19:31:16 +0000 |
| commit | 0d4dc7e44b10ab2bb6e6ac3d2e9703fbb1718ffe (patch) | |
| tree | 62c30e4d0ef52302a0d49aedb0933ad33abe4947 | |
| parent | Merge branch 'search-match-multi-column-chars-2' (diff) | |
| parent | search: match composed characters when extending the search string to the next word boundary (diff) | |
Merge branch 'search-extend-to-word-boundary-handle-composed-chars'
| -rw-r--r-- | search.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -473,6 +473,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; @@ -480,6 +488,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) |
