aboutsummaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-06-24 15:50:55 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-24 15:50:55 +0000
commit80c2d9d89df11c5830de900f98b5d9f3f406a1c1 (patch)
treea27132ebbd0940872c16afd3f48f4ee791820a0a /search.c
parentMerge branch 'sixel-heap-user-after-free-after-blending' (diff)
parentclient: add +/-graphemes to version output (diff)
Merge branch 'harfbuzz'
Diffstat (limited to 'search.c')
-rw-r--r--search.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/search.c b/search.c
index 9fc1ab2a..8f28a656 100644
--- a/search.c
+++ b/search.c
@@ -245,11 +245,10 @@ matches_cell(const struct terminal *term, const struct cell *cell, size_t search
wchar_t base = cell->wc;
const struct composed *composed = NULL;
- if (base >= CELL_COMB_CHARS_LO &&
- base < (CELL_COMB_CHARS_LO + term->composed_count))
+ if (base >= CELL_COMB_CHARS_LO && base <= CELL_COMB_CHARS_HI)
{
- composed = &term->composed[base - CELL_COMB_CHARS_LO];
- base = composed->base;
+ composed = composed_lookup(term->composed, base - CELL_COMB_CHARS_LO);
+ base = composed->chars[0];
}
if (composed == NULL && base == 0 && term->search.buf[search_ofs] == L' ')
@@ -262,8 +261,8 @@ matches_cell(const struct terminal *term, const struct cell *cell, size_t search
if (search_ofs + 1 + composed->count > term->search.len)
return -1;
- for (size_t j = 0; j < composed->count; j++) {
- if (composed->combining[j] != term->search.buf[search_ofs + 1 + j])
+ for (size_t j = 1; j < composed->count; j++) {
+ if (composed->chars[j] != term->search.buf[search_ofs + 1 + j])
return -1;
}
}