diff options
| author | c4llv07e <igor@c4llv07e.xyz> | 2025-10-27 10:25:48 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-10-30 05:36:12 +0000 |
| commit | 5ae4955e834831b5680baaad7c4f974e407ffb7a (patch) | |
| tree | 4f0642bc449c786f28145863899f34a9d7b11c19 /search.c | |
| parent | char32: add helper functions to work with c32 case (diff) | |
search: use case insensitive search only if there's no uppercase in search
Diffstat (limited to 'search.c')
| -rw-r--r-- | search.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -283,8 +283,13 @@ matches_cell(const struct terminal *term, const struct cell *cell, size_t search if (composed == NULL && base == 0 && term->search.buf[search_ofs] == U' ') return 1; - if (c32ncasecmp(&base, &term->search.buf[search_ofs], 1) != 0) - return -1; + if (hasc32upper(term->search.buf)) { + if (c32ncmp(&base, &term->search.buf[search_ofs], 1) != 0) + return -1; + } else { + if (c32ncasecmp(&base, &term->search.buf[search_ofs], 1) != 0) + return -1; + } if (composed != NULL) { if (search_ofs + composed->count > term->search.len) |
