tAllow more complex delimiters for word selections. - st - [fork] customized bu… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 8e968739c3cfc4e9f7088a9ea360bc4f37e9ad9f | |
parent 0c2b513d01697aea20bb4a2a144b55e72c625e86 | |
Author: Christoph Lohmann <[email protected]> | |
Date: Sat, 4 May 2013 19:04:20 +0200 | |
Allow more complex delimiters for word selections. | |
Thanks Alexander Rezinsky <[email protected]>! | |
Diffstat: | |
M config.def.h | 9 ++++++++- | |
M st.c | 4 +++- | |
2 files changed, 11 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/config.def.h b/config.def.h | |
t@@ -9,7 +9,14 @@ static char font[] = "Liberation Mono:pixelsize=12:antialias=… | |
static int borderpx = 2; | |
static char shell[] = "/bin/sh"; | |
-/* timeouts (in milliseconds) */ | |
+/* | |
+ * word delimiter string | |
+ * | |
+ * More advanced example: " `'\"()[]{}" | |
+ */ | |
+static char worddelimiters[] = " "; | |
+ | |
+/* selection timeouts (in milliseconds) */ | |
static unsigned int doubleclicktimeout = 300; | |
static unsigned int tripleclicktimeout = 600; | |
diff --git a/st.c b/st.c | |
t@@ -707,8 +707,10 @@ selsnap(int mode, int *x, int *y, int direction) { | |
} | |
} | |
- if(term.line[*y][*x + direction].c[0] == ' ') | |
+ if(strchr(worddelimiters, | |
+ term.line[*y][*x + direction].c[0])) { | |
break; | |
+ } | |
*x += direction; | |
} |