mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
Use case insensitive search only if there's no uppercase in search
This commit is contained in:
parent
4c5c538a1e
commit
8e77228faa
1 changed files with 7 additions and 2 deletions
9
search.c
9
search.c
|
|
@ -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' ')
|
if (composed == NULL && base == 0 && term->search.buf[search_ofs] == U' ')
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (c32ncasecmp(&base, &term->search.buf[search_ofs], 1) != 0)
|
if (hasc32upper(term->search.buf)) {
|
||||||
return -1;
|
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 (composed != NULL) {
|
||||||
if (search_ofs + composed->count > term->search.len)
|
if (search_ofs + composed->count > term->search.len)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue