mirror of
https://github.com/alrayyes/st.git
synced 2024-11-26 12:56:22 +00:00
Allow more complex delimiters for word selections.
Thanks Alexander Rezinsky <alexrez@gmail.com>!
This commit is contained in:
parent
0c2b513d01
commit
8e968739c3
2 changed files with 11 additions and 2 deletions
|
@ -9,7 +9,14 @@ static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=fals
|
||||||
static int borderpx = 2;
|
static int borderpx = 2;
|
||||||
static char shell[] = "/bin/sh";
|
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 doubleclicktimeout = 300;
|
||||||
static unsigned int tripleclicktimeout = 600;
|
static unsigned int tripleclicktimeout = 600;
|
||||||
|
|
||||||
|
|
4
st.c
4
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;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
*x += direction;
|
*x += direction;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue