mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
selection: find_word_boundary{left,right}: handle composed characters
This commit is contained in:
parent
736ff0421c
commit
c821914e67
1 changed files with 24 additions and 0 deletions
24
selection.c
24
selection.c
|
|
@ -243,6 +243,12 @@ find_word_boundary_left(struct terminal *term, struct coord *pos,
|
|||
const struct row *r = grid_row_in_view(term->grid, pos->row);
|
||||
wchar_t c = r->cells[pos->col].wc;
|
||||
|
||||
if (c >= CELL_COMB_CHARS_LO &&
|
||||
c < (CELL_COMB_CHARS_LO + term->composed_count))
|
||||
{
|
||||
c = term->composed[c - CELL_COMB_CHARS_LO].base;
|
||||
}
|
||||
|
||||
if (!(c != CELL_MULT_COL_SPACER &&
|
||||
(c == 0 || !isword(c, spaces_only, term->conf->word_delimiters))))
|
||||
{
|
||||
|
|
@ -260,6 +266,12 @@ find_word_boundary_left(struct terminal *term, struct coord *pos,
|
|||
const struct row *row = grid_row_in_view(term->grid, next_row);
|
||||
|
||||
c = row->cells[next_col].wc;
|
||||
if (c >= CELL_COMB_CHARS_LO &&
|
||||
c < (CELL_COMB_CHARS_LO + term->composed_count))
|
||||
{
|
||||
c = term->composed[c - CELL_COMB_CHARS_LO].base;
|
||||
}
|
||||
|
||||
if (c != CELL_MULT_COL_SPACER &&
|
||||
(c == 0 ||
|
||||
!isword(c, spaces_only, term->conf->word_delimiters)))
|
||||
|
|
@ -280,6 +292,12 @@ find_word_boundary_right(struct terminal *term, struct coord *pos,
|
|||
const struct row *r = grid_row_in_view(term->grid, pos->row);
|
||||
wchar_t c = r->cells[pos->col].wc;
|
||||
|
||||
if (c >= CELL_COMB_CHARS_LO &&
|
||||
c < (CELL_COMB_CHARS_LO + term->composed_count))
|
||||
{
|
||||
c = term->composed[c - CELL_COMB_CHARS_LO].base;
|
||||
}
|
||||
|
||||
if (!(c != CELL_MULT_COL_SPACER &&
|
||||
(c == 0 || !isword(c, spaces_only, term->conf->word_delimiters))))
|
||||
{
|
||||
|
|
@ -297,6 +315,12 @@ find_word_boundary_right(struct terminal *term, struct coord *pos,
|
|||
const struct row *row = grid_row_in_view(term->grid, next_row);
|
||||
|
||||
c = row->cells[next_col].wc;
|
||||
if (c >= CELL_COMB_CHARS_LO &&
|
||||
c < (CELL_COMB_CHARS_LO + term->composed_count))
|
||||
{
|
||||
c = term->composed[c - CELL_COMB_CHARS_LO].base;
|
||||
}
|
||||
|
||||
if (c != CELL_MULT_COL_SPACER &&
|
||||
(c == 0 ||
|
||||
!isword(c, spaces_only, term->conf->word_delimiters)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue