aboutsummaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/misc.c b/misc.c
index b8eb3296..feb5e73b 100644
--- a/misc.c
+++ b/misc.c
@@ -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);
}