diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-10-09 17:44:23 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-10-09 17:44:23 +0000 |
| commit | 49f4b3da64d45cee04295ce005ff0399fcfeebe2 (patch) | |
| tree | 307eba129b6e0fdf8a921e9c9107cd91dd944fcf /misc.c | |
| parent | xmalloc: add xwcsdup() (diff) | |
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
Diffstat (limited to 'misc.c')
| -rw-r--r-- | misc.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -3,22 +3,13 @@ #include <wctype.h> bool -isword(wchar_t wc, bool spaces_only) +isword(wchar_t wc, bool spaces_only, const wchar_t *delimiters) { if (spaces_only) return iswgraph(wc); - switch (wc) { - default: return iswgraph(wc); - - case L'(': case L')': - case L'[': case L']': - case L'{': case L'}': - case L'<': case L'>': - case L'│': case L'|': - case L',': - case L'`': case L'"': case L'\'': - case L':': + if (wcschr(delimiters, wc) != NULL) return false; - } + + return iswgraph(wc); } |
