If a word delimiter was at the very beginning or end of one of the
different lines composing a wrapped line, the delimiter was ignored for
word selection. This now checks for delimiters before moving on to the
next part of a wrapped line.
---
st.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/st.c b/st.c
index e0c64e3..912a37e 100644
--- a/st.c
+++ b/st.c
@@ -711,8 +711,9 @@ selsnap(int mode, int *x, int *y, int direction) {
*/
for(;;) {
if(direction < 0 && *x <= 0) {
- if(*y > 0 && term.line[*y - 1][term.col-1].mode
- & ATTR_WRAP) {
+ if(*y > 0 && term.line[*y-1][term.col-1].mode &
ATTR_WRAP
+ && !strchr(worddelimiters,
+
term.line[*y-1][term.col-1].c[0])) {
*y -= 1;
*x = term.col-1;
} else {
@@ -720,8 +721,8 @@ selsnap(int mode, int *x, int *y, int direction) {
}
}
if(direction > 0 && *x >= term.col-1) {
- if(*y < term.row-1 && term.line[*y][*x].mode
- & ATTR_WRAP) {
+ if(*y < term.row-1 && term.line[*y][*x].mode &
ATTR_WRAP
+ && !strchr(worddelimiters,
term.line[*y+1][0].c[0])) {
*y += 1;
*x = 0;
} else {
--
2.0.0
--
Ivan "Colona" Delalande