mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
selection: break out isword() to a new file
This commit is contained in:
parent
f1c876884a
commit
198529525c
4 changed files with 32 additions and 21 deletions
24
misc.c
Normal file
24
misc.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include "misc.h"
|
||||
|
||||
#include <wctype.h>
|
||||
|
||||
bool
|
||||
isword(wchar_t wc, bool spaces_only)
|
||||
{
|
||||
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':':
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue