mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-26 07:57:59 -04:00
selection: update: find_word_boundary_{left,right}: coordinates are screen local
This commit is contained in:
parent
c851aae9d6
commit
683f63c929
1 changed files with 10 additions and 4 deletions
14
selection.c
14
selection.c
|
|
@ -667,13 +667,19 @@ selection_update(struct terminal *term, int col, int row)
|
||||||
|
|
||||||
case SELECTION_SEMANTIC_WORD:
|
case SELECTION_SEMANTIC_WORD:
|
||||||
switch (term->selection.direction) {
|
switch (term->selection.direction) {
|
||||||
case SELECTION_LEFT:
|
case SELECTION_LEFT: {
|
||||||
find_word_boundary_left(term, &new_end, term->selection.spaces_only);
|
struct coord end = {col, row};
|
||||||
|
find_word_boundary_left(term, &end, term->selection.spaces_only);
|
||||||
|
new_end = (struct coord){end.col, term->grid->view + end.row};
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SELECTION_RIGHT:
|
case SELECTION_RIGHT: {
|
||||||
find_word_boundary_right(term, &new_end, term->selection.spaces_only);
|
struct coord end = {col, row};
|
||||||
|
find_word_boundary_right(term, &end, term->selection.spaces_only);
|
||||||
|
new_end = (struct coord){end.col, term->grid->view + end.row};
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SELECTION_UNDIR:
|
case SELECTION_UNDIR:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue