Deleted Added
full compact
common.c (148900) common.c (167457)
1/*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Christos Zoulas of Cornell University.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Christos Zoulas of Cornell University.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $NetBSD: common.c,v 1.18 2005/08/08 14:05:37 christos Exp $
32 * $NetBSD: common.c,v 1.19 2006/03/06 21:11:56 christos Exp $
33 */
34
35#if !defined(lint) && !defined(SCCSID)
36static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
37#endif /* not lint && not SCCSID */
38#include <sys/cdefs.h>
33 */
34
35#if !defined(lint) && !defined(SCCSID)
36static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
37#endif /* not lint && not SCCSID */
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/lib/libedit/common.c 148900 2005-08-09 13:37:59Z stefanf $");
39__FBSDID("$FreeBSD: head/lib/libedit/common.c 167457 2007-03-11 18:30:22Z stefanf $");
40
41/*
42 * common.c: Common Editor functions
43 */
44#include "sys.h"
45#include "el.h"
46
47/* ed_end_of_file():

--- 82 unchanged lines hidden (view full) ---

130
131
132/* ed_delete_next_char():
133 * Delete character under cursor
134 * [^D] [x]
135 */
136protected el_action_t
137/*ARGSUSED*/
40
41/*
42 * common.c: Common Editor functions
43 */
44#include "sys.h"
45#include "el.h"
46
47/* ed_end_of_file():

--- 82 unchanged lines hidden (view full) ---

130
131
132/* ed_delete_next_char():
133 * Delete character under cursor
134 * [^D] [x]
135 */
136protected el_action_t
137/*ARGSUSED*/
138ed_delete_next_char(EditLine *el, int c __unused)
138ed_delete_next_char(EditLine *el, int c)
139{
140#ifdef notdef /* XXX */
141#define EL el->el_line
142 (void) fprintf(el->el_errlfile,
143 "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n",
144 EL.buffer, EL.buffer, EL.cursor, EL.cursor, EL.lastchar,
145 EL.lastchar, EL.limit, EL.limit);
146#endif
147 if (el->el_line.cursor == el->el_line.lastchar) {
148 /* if I'm at the end */
149 if (el->el_map.type == MAP_VI) {
150 if (el->el_line.cursor == el->el_line.buffer) {
151 /* if I'm also at the beginning */
152#ifdef KSHVI
153 return (CC_ERROR);
154#else
139{
140#ifdef notdef /* XXX */
141#define EL el->el_line
142 (void) fprintf(el->el_errlfile,
143 "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n",
144 EL.buffer, EL.buffer, EL.cursor, EL.cursor, EL.lastchar,
145 EL.lastchar, EL.limit, EL.limit);
146#endif
147 if (el->el_line.cursor == el->el_line.lastchar) {
148 /* if I'm at the end */
149 if (el->el_map.type == MAP_VI) {
150 if (el->el_line.cursor == el->el_line.buffer) {
151 /* if I'm also at the beginning */
152#ifdef KSHVI
153 return (CC_ERROR);
154#else
155 term_overwrite(el, STReof, 4);
156 /* then do an EOF */
157 term__flush();
155 /* then do an EOF */
156 term_writechar(el, c);
158 return (CC_EOF);
159#endif
160 } else {
161#ifdef KSHVI
162 el->el_line.cursor--;
163#else
164 return (CC_ERROR);
165#endif

--- 755 unchanged lines hidden ---
157 return (CC_EOF);
158#endif
159 } else {
160#ifdef KSHVI
161 el->el_line.cursor--;
162#else
163 return (CC_ERROR);
164#endif

--- 755 unchanged lines hidden ---