2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1992, 1993, 1994, 1995, 1996
5 * Keith Bostic. All rights reserved.
7 * See the LICENSE file for redistribution information.
13 static const char sccsid
[] = "$Id: v_util.c,v 10.13 2000/07/14 14:29:25 skimo Exp $ (Berkeley) $Date: 2000/07/14 14:29:25 $";
16 #include <sys/types.h>
17 #include <sys/queue.h>
20 #include <bitstring.h>
28 #include "../common/common.h"
33 * Vi end-of-file error.
35 * PUBLIC: void v_eof __P((SCR *, MARK *));
45 v_emsg(sp
, NULL
, VIM_EOF
);
47 if (db_last(sp
, &lno
))
50 v_emsg(sp
, NULL
, VIM_EOF
);
52 msgq(sp
, M_BERR
, "195|Movement past the end-of-file");
58 * Vi end-of-line error.
60 * PUBLIC: void v_eol __P((SCR *, MARK *));
70 v_emsg(sp
, NULL
, VIM_EOL
);
72 if (db_get(sp
, mp
->lno
, DBG_FATAL
, NULL
, &len
))
74 if (mp
->cno
== len
- 1)
75 v_emsg(sp
, NULL
, VIM_EOL
);
77 msgq(sp
, M_BERR
, "196|Movement past the end-of-line");
83 * Vi no cursor movement error.
85 * PUBLIC: void v_nomove __P((SCR *));
91 msgq(sp
, M_BERR
, "197|No cursor movement made");
96 * Vi start-of-file error.
98 * PUBLIC: void v_sof __P((SCR *, MARK *));
105 if (mp
== NULL
|| mp
->lno
== 1)
106 msgq(sp
, M_BERR
, "198|Already at the beginning of the file");
108 msgq(sp
, M_BERR
, "199|Movement past the beginning of the file");
113 * Vi start-of-line error.
115 * PUBLIC: void v_sol __P((SCR *));
121 msgq(sp
, M_BERR
, "200|Already in the first column");
126 * Return if the line contains nothing but white-space characters.
128 * PUBLIC: int v_isempty __P((CHAR_T *, size_t));
143 * Display a few common vi messages.
145 * PUBLIC: void v_emsg __P((SCR *, char *, vim_t));
156 "201|Buffers should be specified before the command");
159 msgq(sp
, M_BERR
, "209|The file is empty");
162 msgq(sp
, M_BERR
, "202|Already at end-of-file");
165 msgq(sp
, M_BERR
, "203|Already at end-of-line");
170 which
== VIM_NOCOM_B
? M_BERR
: M_ERR
,
171 "204|%s isn't a vi command", p
);
174 msgq(sp
, M_ERR
, "Window resize interrupted text input mode");
177 msgq(sp
, M_ERR
, "205|Usage: %s", p
);