Deleted Added
full compact
common.c (256281) common.c (268782)
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.19 2006/03/06 21:11:56 christos Exp $
32 * $NetBSD: common.c,v 1.23 2009/02/27 04:18:45 msaitoh 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: stable/10/lib/libedit/common.c 237448 2012-06-22 18:01:22Z pfg $");
39__FBSDID("$FreeBSD: stable/10/lib/libedit/common.c 268782 2014-07-17 02:14:25Z pfg $");
40
41/*
42 * common.c: Common Editor functions
43 */
44#include "sys.h"
45#include "el.h"
46
47/* ed_end_of_file():

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

116
117 cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
118 el->el_state.argument, ce__isword);
119
120 for (p = cp, kp = el->el_chared.c_kill.buf; p < el->el_line.cursor; p++)
121 *kp++ = *p;
122 el->el_chared.c_kill.last = kp;
123
40
41/*
42 * common.c: Common Editor functions
43 */
44#include "sys.h"
45#include "el.h"
46
47/* ed_end_of_file():

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

116
117 cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
118 el->el_state.argument, ce__isword);
119
120 for (p = cp, kp = el->el_chared.c_kill.buf; p < el->el_line.cursor; p++)
121 *kp++ = *p;
122 el->el_chared.c_kill.last = kp;
123
124 c_delbefore(el, el->el_line.cursor - cp); /* delete before dot */
124 c_delbefore(el, (int)(el->el_line.cursor - cp));/* delete before dot */
125 el->el_line.cursor = cp;
126 if (el->el_line.cursor < el->el_line.buffer)
127 el->el_line.cursor = el->el_line.buffer; /* bounds check */
128 return (CC_REFRESH);
129}
130
131
132/* ed_delete_next_char():

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

203 */
204protected el_action_t
205/*ARGSUSED*/
206ed_move_to_end(EditLine *el, int c __unused)
207{
208
209 el->el_line.cursor = el->el_line.lastchar;
210 if (el->el_map.type == MAP_VI) {
125 el->el_line.cursor = cp;
126 if (el->el_line.cursor < el->el_line.buffer)
127 el->el_line.cursor = el->el_line.buffer; /* bounds check */
128 return (CC_REFRESH);
129}
130
131
132/* ed_delete_next_char():

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

203 */
204protected el_action_t
205/*ARGSUSED*/
206ed_move_to_end(EditLine *el, int c __unused)
207{
208
209 el->el_line.cursor = el->el_line.lastchar;
210 if (el->el_map.type == MAP_VI) {
211#ifdef VI_MOVE
212 el->el_line.cursor--;
213#endif
214 if (el->el_chared.c_vcmd.action != NOP) {
215 cv_delfini(el);
216 return (CC_REFRESH);
217 }
218 }
219 return (CC_CURSOR);
220}
221

--- 695 unchanged lines hidden ---
211 if (el->el_chared.c_vcmd.action != NOP) {
212 cv_delfini(el);
213 return (CC_REFRESH);
214 }
215 }
216 return (CC_CURSOR);
217}
218

--- 695 unchanged lines hidden ---