diff --git a/selection.c b/selection.c index da89b006..0f856c78 100644 --- a/selection.c +++ b/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)))