Xinqi Bao's Git
projects
/
st.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
| inline |
side by side
(from parent 1:
0c2b513
)
Allow more complex delimiters for word selections.
author
Christoph Lohmann <
[email protected]
>
Sat, 4 May 2013 17:04:20 +0000
(19:04 +0200)
committer
Christoph Lohmann <
[email protected]
>
Sat, 4 May 2013 17:04:20 +0000
(19:04 +0200)
Thanks Alexander Rezinsky <
[email protected]
>!
config.def.h
patch
|
blob
|
history
st.c
patch
|
blob
|
history
diff --git
a/config.def.h
b/config.def.h
index
d9a0568
..
2d854a0
100644
(file)
--- a/
config.def.h
+++ b/
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;
diff --git
a/st.c
b/st.c
index
0f47d6d
..
5251e70
100644
(file)
--- a/
st.c
+++ b/
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;
}