diff options
| author | christos <christos@NetBSD.org> | 2005-08-09 16:40:12 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2005-08-09 16:40:12 +0000 |
| commit | fda9b4f722452dffbdbddd560d287137ca2e8790 (patch) | |
| tree | cbf9dfec43340d3de89d0feaf3deb838fe8fa953 /lib/libedit | |
| parent | 1042d80dad40553ea40819d60b7c9a5b7cf9b73d (diff) | |
Don't delete the current line in vi mode when typing 'yy'.
From Stefan Farfeleder.
Diffstat (limited to 'lib/libedit')
| -rw-r--r-- | lib/libedit/vi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libedit/vi.c b/lib/libedit/vi.c index d9bc8b59d60..91dbfa7211b 100644 --- a/lib/libedit/vi.c +++ b/lib/libedit/vi.c @@ -1,4 +1,4 @@ -/* $NetBSD: vi.c,v 1.22 2005/08/08 14:05:37 christos Exp $ */ +/* $NetBSD: vi.c,v 1.23 2005/08/09 16:40:12 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vi.c,v 1.22 2005/08/08 14:05:37 christos Exp $"); +__RCSID("$NetBSD: vi.c,v 1.23 2005/08/09 16:40:12 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -71,8 +71,10 @@ cv_action(EditLine *el, int c) el->el_line.lastchar - el->el_line.buffer); el->el_chared.c_vcmd.action = NOP; el->el_chared.c_vcmd.pos = 0; - el->el_line.lastchar = el->el_line.buffer; - el->el_line.cursor = el->el_line.buffer; + if (!(c & YANK)) { + el->el_line.lastchar = el->el_line.buffer; + el->el_line.cursor = el->el_line.buffer; + } if (c & INSERT) el->el_map.current = el->el_map.key; |
