From 5613b3a5acb7082ba4f9d133f1cfe62bc5ed67d3 Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 8 Jun 2009 20:22:19 +0000 Subject: [PATCH] =?UTF-8?q?and=20today=E2=80=99s=20last=20oksh=20merge,=20?= =?UTF-8?q?from=20merdely:=20I=20quote:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "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@ .oO(there are vi mode users?) We are not GNU bash, good idea! tg@ --- edit.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/edit.c b/edit.c index 1d63b12..c00eef9 100644 --- a/edit.c +++ b/edit.c @@ -1,7 +1,7 @@ /* $OpenBSD: edit.c,v 1.33 2007/08/02 10:50:25 fgsch Exp $ */ /* $OpenBSD: edit.h,v 1.8 2005/03/28 21:28:22 deraadt Exp $ */ /* $OpenBSD: emacs.c,v 1.42 2009/06/02 06:47:47 halex Exp $ */ -/* $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 $ */ /*- * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009 @@ -25,7 +25,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.166 2009/06/08 20:16:01 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.167 2009/06/08 20:22:19 tg Exp $"); /* tty driver characters we are interested in */ typedef struct { @@ -3871,9 +3871,9 @@ vi_hook(int ch) int i; int n = srchlen; - while (n > 0 && ksh_isspace(locpat[n - 1])) + while (n > 0 && !ksh_isalnux(locpat[n - 1])) n--; - while (n > 0 && !ksh_isspace(locpat[n - 1])) + while (n > 0 && ksh_isalnux(locpat[n - 1])) n--; for (i = srchlen; --i >= n; ) es->linelen -= char_len((unsigned char)locpat[i]); @@ -5006,10 +5006,10 @@ Backword(int argcnt) ncursor = es->cursor; while (ncursor > 0 && argcnt--) { while (--ncursor >= 0 && - ksh_isspace(es->cbuf[ncursor])) + !ksh_isalnux(es->cbuf[ncursor])) ; while (ncursor >= 0 && - !ksh_isspace(es->cbuf[ncursor])) + ksh_isalnux(es->cbuf[ncursor])) ncursor--; ncursor++; }