mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-04 07:15:29 -04:00
selection: remember whether word-wise selection uses spaces only for delimiters
This commit is contained in:
parent
a1b52ee4a0
commit
bef69cb961
2 changed files with 5 additions and 2 deletions
|
|
@ -504,11 +504,11 @@ 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, false);
|
find_word_boundary_left(term, &new_end, term->selection.spaces_only);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SELECTION_RIGHT:
|
case SELECTION_RIGHT:
|
||||||
find_word_boundary_right(term, &new_end, false);
|
find_word_boundary_right(term, &new_end, term->selection.spaces_only);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SELECTION_UNDIR:
|
case SELECTION_UNDIR:
|
||||||
|
|
@ -847,6 +847,8 @@ selection_mark_word(struct seat *seat, struct terminal *term, int col, int row,
|
||||||
|
|
||||||
selection_start(term, start.col, start.row,
|
selection_start(term, start.col, start.row,
|
||||||
SELECTION_NORMAL, SELECTION_SEMANTIC_WORD);
|
SELECTION_NORMAL, SELECTION_SEMANTIC_WORD);
|
||||||
|
term->selection.spaces_only = spaces_only;
|
||||||
|
|
||||||
selection_update(term, end.col, end.row);
|
selection_update(term, end.col, end.row);
|
||||||
selection_finalize(seat, term, serial);
|
selection_finalize(seat, term, serial);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -365,6 +365,7 @@ struct terminal {
|
||||||
struct coord start;
|
struct coord start;
|
||||||
struct coord end;
|
struct coord end;
|
||||||
bool ongoing;
|
bool ongoing;
|
||||||
|
bool spaces_only; /* SELECTION_SEMANTIC_WORD */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int fd;
|
int fd;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue