selection: break out isword() to a new file

This commit is contained in:
Daniel Eklöf 2019-12-03 19:16:05 +01:00
parent f1c876884a
commit 198529525c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 32 additions and 21 deletions

View file

@ -15,6 +15,7 @@
#include "async.h"
#include "grid.h"
#include "misc.h"
#include "render.h"
#include "vt.h"
@ -222,27 +223,6 @@ selection_cancel(struct terminal *term)
}
}
static bool
isword(wint_t c, bool spaces_only)
{
if (spaces_only)
return !iswspace(c);
switch (c) {
default: return !iswspace(c);
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;
}
}
void
selection_mark_word(struct terminal *term, int col, int row, bool spaces_only,
uint32_t serial)