aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-02 20:38:41 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-04 18:48:41 +0000
commitbef69cb9610fc296c001974fa85e0289d21f55c2 (patch)
tree2929fada0d5b3836828de2b861ab451176432cee
parentchangelog: double- or triple clicking then dragging extends word- or line-wise (diff)
selection: remember whether word-wise selection uses spaces only for delimiters
-rw-r--r--selection.c6
-rw-r--r--terminal.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/selection.c b/selection.c
index 615088d8..7e21ecdb 100644
--- a/selection.c
+++ b/selection.c
@@ -504,11 +504,11 @@ selection_update(struct terminal *term, int col, int row)
case SELECTION_SEMANTIC_WORD:
switch (term->selection.direction) {
case SELECTION_LEFT:
- find_word_boundary_left(term, &new_end, false);
+ find_word_boundary_left(term, &new_end, term->selection.spaces_only);
break;
case SELECTION_RIGHT:
- find_word_boundary_right(term, &new_end, false);
+ find_word_boundary_right(term, &new_end, term->selection.spaces_only);
break;
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_NORMAL, SELECTION_SEMANTIC_WORD);
+ term->selection.spaces_only = spaces_only;
+
selection_update(term, end.col, end.row);
selection_finalize(seat, term, serial);
}
diff --git a/terminal.h b/terminal.h
index c158d214..52eb0a84 100644
--- a/terminal.h
+++ b/terminal.h
@@ -365,6 +365,7 @@ struct terminal {
struct coord start;
struct coord end;
bool ongoing;
+ bool spaces_only; /* SELECTION_SEMANTIC_WORD */
struct {
int fd;