| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: vi.c,v 1.34 2011/02/22 05:45:08 joerg Exp $ */ | | 1 | /* $NetBSD: vi.c,v 1.35 2011/07/28 00:45:14 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1992, 1993 | | 4 | * Copyright (c) 1992, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Christos Zoulas of Cornell University. | | 8 | * Christos Zoulas of Cornell University. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -32,27 +32,27 @@ | | | @@ -32,27 +32,27 @@ |
32 | * SUCH DAMAGE. | | 32 | * SUCH DAMAGE. |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #include "config.h" | | 35 | #include "config.h" |
36 | #include <stdlib.h> | | 36 | #include <stdlib.h> |
37 | #include <unistd.h> | | 37 | #include <unistd.h> |
38 | #include <limits.h> | | 38 | #include <limits.h> |
39 | #include <sys/wait.h> | | 39 | #include <sys/wait.h> |
40 | | | 40 | |
41 | #if !defined(lint) && !defined(SCCSID) | | 41 | #if !defined(lint) && !defined(SCCSID) |
42 | #if 0 | | 42 | #if 0 |
43 | static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; | | 43 | static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; |
44 | #else | | 44 | #else |
45 | __RCSID("$NetBSD: vi.c,v 1.34 2011/02/22 05:45:08 joerg Exp $"); | | 45 | __RCSID("$NetBSD: vi.c,v 1.35 2011/07/28 00:45:14 christos Exp $"); |
46 | #endif | | 46 | #endif |
47 | #endif /* not lint && not SCCSID */ | | 47 | #endif /* not lint && not SCCSID */ |
48 | | | 48 | |
49 | /* | | 49 | /* |
50 | * vi.c: Vi mode commands. | | 50 | * vi.c: Vi mode commands. |
51 | */ | | 51 | */ |
52 | #include "el.h" | | 52 | #include "el.h" |
53 | | | 53 | |
54 | private el_action_t cv_action(EditLine *, Int); | | 54 | private el_action_t cv_action(EditLine *, Int); |
55 | private el_action_t cv_paste(EditLine *, Int); | | 55 | private el_action_t cv_paste(EditLine *, Int); |
56 | | | 56 | |
57 | /* cv_action(): | | 57 | /* cv_action(): |
58 | * Handle vi actions. | | 58 | * Handle vi actions. |
| @@ -598,46 +598,46 @@ vi_delete_prev_char(EditLine *el, Int c | | | @@ -598,46 +598,46 @@ vi_delete_prev_char(EditLine *el, Int c |
598 | | | 598 | |
599 | | | 599 | |
600 | /* vi_list_or_eof(): | | 600 | /* vi_list_or_eof(): |
601 | * Vi list choices for completion or indicate end of file if empty line | | 601 | * Vi list choices for completion or indicate end of file if empty line |
602 | * [^D] | | 602 | * [^D] |
603 | */ | | 603 | */ |
604 | protected el_action_t | | 604 | protected el_action_t |
605 | /*ARGSUSED*/ | | 605 | /*ARGSUSED*/ |
606 | vi_list_or_eof(EditLine *el, Int c) | | 606 | vi_list_or_eof(EditLine *el, Int c) |
607 | { | | 607 | { |
608 | | | 608 | |
609 | if (el->el_line.cursor == el->el_line.lastchar) { | | 609 | if (el->el_line.cursor == el->el_line.lastchar) { |
610 | if (el->el_line.cursor == el->el_line.buffer) { | | 610 | if (el->el_line.cursor == el->el_line.buffer) { |
611 | term_writec(el, c); /* then do a EOF */ | | 611 | terminal_writec(el, c); /* then do a EOF */ |
612 | return (CC_EOF); | | 612 | return (CC_EOF); |
613 | } else { | | 613 | } else { |
614 | /* | | 614 | /* |
615 | * Here we could list completions, but it is an | | 615 | * Here we could list completions, but it is an |
616 | * error right now | | 616 | * error right now |
617 | */ | | 617 | */ |
618 | term_beep(el); | | 618 | terminal_beep(el); |
619 | return (CC_ERROR); | | 619 | return (CC_ERROR); |
620 | } | | 620 | } |
621 | } else { | | 621 | } else { |
622 | #ifdef notyet | | 622 | #ifdef notyet |
623 | re_goto_bottom(el); | | 623 | re_goto_bottom(el); |
624 | *el->el_line.lastchar = '\0'; /* just in case */ | | 624 | *el->el_line.lastchar = '\0'; /* just in case */ |
625 | return (CC_LIST_CHOICES); | | 625 | return (CC_LIST_CHOICES); |
626 | #else | | 626 | #else |
627 | /* | | 627 | /* |
628 | * Just complain for now. | | 628 | * Just complain for now. |
629 | */ | | 629 | */ |
630 | term_beep(el); | | 630 | terminal_beep(el); |
631 | return (CC_ERROR); | | 631 | return (CC_ERROR); |
632 | #endif | | 632 | #endif |
633 | } | | 633 | } |
634 | } | | 634 | } |
635 | | | 635 | |
636 | | | 636 | |
637 | /* vi_kill_line_prev(): | | 637 | /* vi_kill_line_prev(): |
638 | * Vi cut from beginning of line to cursor | | 638 | * Vi cut from beginning of line to cursor |
639 | * [^U] | | 639 | * [^U] |
640 | */ | | 640 | */ |
641 | protected el_action_t | | 641 | protected el_action_t |
642 | /*ARGSUSED*/ | | 642 | /*ARGSUSED*/ |
643 | vi_kill_line_prev(EditLine *el, Int c __attribute__((__unused__))) | | 643 | vi_kill_line_prev(EditLine *el, Int c __attribute__((__unused__))) |