Commit 8e96873

Christoph Lohmann <20h@r-36.net>
2013-05-04 13:04:20
Allow more complex delimiters for word selections.
Thanks Alexander Rezinsky <alexrez@gmail.com>!
1 parent 0c2b513
Changed files (2)
config.def.h
@@ -9,7 +9,14 @@ static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=fals
 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;
 
st.c
@@ -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;
 		}