mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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:
parent
8aba25a477
commit
49f4b3da64
8 changed files with 36 additions and 20 deletions
17
misc.c
17
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue