diff options
| author | Christoph Lohmann <20h@r-36.net> | 2013-05-04 19:04:20 +0200 |
|---|---|---|
| committer | Christoph Lohmann <20h@r-36.net> | 2013-05-04 19:04:20 +0200 |
| commit | 8e968739c3cfc4e9f7088a9ea360bc4f37e9ad9f (patch) | |
| tree | 216f0beee22b1d7a3703537a8f98cf90e52c22ae | |
| parent | 0c2b513d01697aea20bb4a2a144b55e72c625e86 (diff) | |
| download | st-8e968739c3cfc4e9f7088a9ea360bc4f37e9ad9f.tar.gz st-8e968739c3cfc4e9f7088a9ea360bc4f37e9ad9f.zip | |
Allow more complex delimiters for word selections.
Thanks Alexander Rezinsky <alexrez@gmail.com>!
| -rw-r--r-- | config.def.h | 9 | ||||
| -rw-r--r-- | st.c | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h index d9a0568..2d854a0 100644 --- a/config.def.h +++ b/config.def.h | |||
| @@ -9,7 +9,14 @@ static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=fals | |||
| 9 | static int borderpx = 2; | 9 | static int borderpx = 2; |
| 10 | static char shell[] = "/bin/sh"; | 10 | static char shell[] = "/bin/sh"; |
| 11 | 11 | ||
| 12 | /* timeouts (in milliseconds) */ | 12 | /* |
| 13 | * word delimiter string | ||
| 14 | * | ||
| 15 | * More advanced example: " `'\"()[]{}" | ||
| 16 | */ | ||
| 17 | static char worddelimiters[] = " "; | ||
| 18 | |||
| 19 | /* selection timeouts (in milliseconds) */ | ||
| 13 | static unsigned int doubleclicktimeout = 300; | 20 | static unsigned int doubleclicktimeout = 300; |
| 14 | static unsigned int tripleclicktimeout = 600; | 21 | static unsigned int tripleclicktimeout = 600; |
| 15 | 22 | ||
| @@ -707,8 +707,10 @@ selsnap(int mode, int *x, int *y, int direction) { | |||
| 707 | } | 707 | } |
| 708 | } | 708 | } |
| 709 | 709 | ||
| 710 | if(term.line[*y][*x + direction].c[0] == ' ') | 710 | if(strchr(worddelimiters, |
| 711 | term.line[*y][*x + direction].c[0])) { | ||
| 711 | break; | 712 | break; |
| 713 | } | ||
| 712 | 714 | ||
| 713 | *x += direction; | 715 | *x += direction; |
| 714 | } | 716 | } |
