config: add ‘[default].word-delimiters’

This option lets the user configure which characters act as word
delimiters when selecting text.

This affects both “double clicking”, and ‘ctrl-w’ in scrollback search
mode.

Closes #156
This commit is contained in:
Daniel Eklöf 2020-10-09 19:44:23 +02:00
parent 8aba25a477
commit 49f4b3da64
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 36 additions and 20 deletions

View file

@ -10,6 +10,7 @@
#define LOG_MODULE "search"
#define LOG_ENABLE_DBG 0
#include "log.h"
#include "config.h"
#include "grid.h"
#include "input.h"
#include "misc.h"
@ -368,7 +369,7 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only)
bool done = false;
for (; end_col < term->cols; end_col++) {
wchar_t wc = row->cells[end_col].wc;
if (wc == 0 || (!first && !isword(wc, spaces_only))) {
if (wc == 0 || (!first && !isword(wc, spaces_only, term->conf->word_delimiters))) {
done = true;
break;
}