mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-10 04:27:45 -05:00
fix wordwise selection crashing due to uninitialised variable
This commit is contained in:
parent
48a748757e
commit
eba65d430e
1 changed files with 7 additions and 7 deletions
14
selection.c
14
selection.c
|
|
@ -758,15 +758,15 @@ selection_start(struct terminal *term, struct coord const start,
|
|||
break;
|
||||
|
||||
case SELECTION_WORD_WISE: {
|
||||
struct coord start = {start.col, term->grid->view + start.row};
|
||||
struct coord end = {start.col, term->grid->view + start.row};
|
||||
selection_find_word_boundary_left(term, &start, spaces_only);
|
||||
selection_find_word_boundary_right(term, &end, spaces_only, true);
|
||||
struct coord first = {start.col, term->grid->view + start.row};
|
||||
struct coord last = {start.col, term->grid->view + start.row};
|
||||
selection_find_word_boundary_left(term, &first, spaces_only);
|
||||
selection_find_word_boundary_right(term, &last, spaces_only, true);
|
||||
|
||||
term->selection.coords.start = start;
|
||||
term->selection.coords.start = first;
|
||||
|
||||
term->selection.pivot.start = term->selection.coords.start;
|
||||
term->selection.pivot.end = end;
|
||||
term->selection.pivot.end = last;
|
||||
|
||||
/*
|
||||
* FIXME: go through selection.c and make sure all public
|
||||
|
|
@ -777,7 +777,7 @@ selection_start(struct terminal *term, struct coord const start,
|
|||
* view-local.
|
||||
*/
|
||||
|
||||
selection_update(term, (struct coord){end.col, end.row - term->grid->view});
|
||||
selection_update(term, (struct coord){last.col, last.row - term->grid->view});
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue