mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-04 01:40:21 -05:00
Merge branch 'search-match-multi-column-chars-2'
This commit is contained in:
commit
e9fa8bb219
2 changed files with 14 additions and 3 deletions
|
|
@ -98,6 +98,7 @@
|
||||||
* Rendering of composed characters in the scrollback search box.
|
* Rendering of composed characters in the scrollback search box.
|
||||||
* IME pre-edit cursor when positioned at the end of the pre-edit
|
* IME pre-edit cursor when positioned at the end of the pre-edit
|
||||||
string.
|
string.
|
||||||
|
* Scrollback search not matching multi-column characters.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
16
search.c
16
search.c
|
|
@ -346,6 +346,11 @@ search_find_next(struct terminal *term)
|
||||||
row = term->grid->rows[end_row];
|
row = term->grid->rows[end_row];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (row->cells[end_col].wc == CELL_MULT_COL_SPACER) {
|
||||||
|
end_col++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ssize_t additional_chars = matches_cell(term, &row->cells[end_col], i);
|
ssize_t additional_chars = matches_cell(term, &row->cells[end_col], i);
|
||||||
if (additional_chars < 0)
|
if (additional_chars < 0)
|
||||||
break;
|
break;
|
||||||
|
|
@ -441,9 +446,11 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only)
|
||||||
|
|
||||||
/* Calculate end coord - note: assumed to be valid */
|
/* Calculate end coord - note: assumed to be valid */
|
||||||
for (size_t i = 0; i < len; i++) {
|
for (size_t i = 0; i < len; i++) {
|
||||||
if (++end_col >= term->cols) {
|
for (size_t j = 0; j < wcwidth(term->search.buf[i]); j++) {
|
||||||
end_row = (end_row + 1) & (term->grid->num_rows - 1);
|
if (++end_col >= term->cols) {
|
||||||
end_col = 0;
|
end_row = (end_row + 1) & (term->grid->num_rows - 1);
|
||||||
|
end_col = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -463,6 +470,9 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only)
|
||||||
bool done = false;
|
bool done = false;
|
||||||
for (; end_col < term->cols; end_col++) {
|
for (; end_col < term->cols; end_col++) {
|
||||||
wchar_t wc = row->cells[end_col].wc;
|
wchar_t wc = row->cells[end_col].wc;
|
||||||
|
if (wc == CELL_MULT_COL_SPACER)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (wc == 0 || (!first && !isword(wc, spaces_only, term->conf->word_delimiters))) {
|
if (wc == 0 || (!first && !isword(wc, spaces_only, term->conf->word_delimiters))) {
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue