summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Erdely <merdely@cvs.openbsd.org>2009-06-04 04:03:23 +0000
committerMichael Erdely <merdely@cvs.openbsd.org>2009-06-04 04:03:23 +0000
commitf971ad1d2273319d1d78584506cf25d14c42aad1 (patch)
tree056c0a22c077319722ad3a59c2cd87d99d71ee7e
parent8d12e1193c938d365e15b4d950af26f53b4b4560 (diff)
"make ksh vi mode handle werase more like vi. It's really irritating to
have whole paths go away on ^W instead of just the last bit." "That looks right to me" millert@, "YES kthx bye!" thib@
-rw-r--r--bin/ksh/vi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ksh/vi.c b/bin/ksh/vi.c
index e815a1cd868..321def17b14 100644
--- a/bin/ksh/vi.c
+++ b/bin/ksh/vi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vi.c,v 1.23 2006/04/10 14:38:59 jaredy Exp $ */
+/* $OpenBSD: vi.c,v 1.24 2009/06/04 04:03:22 merdely Exp $ */
/*
* vi command editing
@@ -416,9 +416,9 @@ vi_hook(int ch)
int i;
int n = srchlen;
- while (n > 0 && isspace(locpat[n - 1]))
+ while (n > 0 && !is_wordch(locpat[n - 1]))
n--;
- while (n > 0 && !isspace(locpat[n - 1]))
+ while (n > 0 && is_wordch(locpat[n - 1]))
n--;
for (i = srchlen; --i >= n; )
es->linelen -= char_len((unsigned char)locpat[i]);
@@ -1598,9 +1598,9 @@ Backword(int argcnt)
ncursor = es->cursor;
while (ncursor > 0 && argcnt--) {
- while (--ncursor >= 0 && isspace(es->cbuf[ncursor]))
+ while (--ncursor >= 0 && !is_wordch(es->cbuf[ncursor]))
;
- while (ncursor >= 0 && !isspace(es->cbuf[ncursor]))
+ while (ncursor >= 0 && is_wordch(es->cbuf[ncursor]))
ncursor--;
ncursor++;
}