From 767bd4f1dbbb14d9d28acb22cf42a91e6305a69a Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 6 Jan 2021 11:11:46 +0100 Subject: config: add ‘select-extend-character-wise’ bind action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This forces the (new) selection mode to be character-wise when extending a word- or line-wise selection. Default key binding is ctrl+RMB. --- input.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'input.c') diff --git a/input.c b/input.c index 3e8019e8..33127afd 100644 --- a/input.c +++ b/input.c @@ -291,7 +291,17 @@ execute_binding(struct seat *seat, struct terminal *term, case BIND_ACTION_SELECT_EXTEND: if (selection_enabled(term, seat) && cursor_is_on_grid) { selection_extend( - seat, term, seat->mouse.col, seat->mouse.row, serial); + seat, term, seat->mouse.col, seat->mouse.row, term->selection.kind); + return true; + } + return false; + + case BIND_ACTION_SELECT_EXTEND_CHAR_WISE: + if (selection_enabled(term, seat) && cursor_is_on_grid && + term->selection.kind != SELECTION_BLOCK) + { + selection_extend( + seat, term, seat->mouse.col, seat->mouse.row, SELECTION_CHAR_WISE); return true; } return false; -- cgit v1.3