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.
12 #include <sys/types.h>
13 #include <sys/queue.h>
16 #include <bitstring.h>
24 #include "../common/common.h"
29 * Vi end-of-file error.
31 * PUBLIC: void v_eof(SCR *, MARK *);
34 v_eof(SCR *sp, MARK *mp)
39 v_emsg(sp, NULL, VIM_EOF);
41 if (db_last(sp, &lno))
44 v_emsg(sp, NULL, VIM_EOF);
46 msgq(sp, M_BERR, "195|Movement past the end-of-file");
52 * Vi end-of-line error.
54 * PUBLIC: void v_eol(SCR *, MARK *);
57 v_eol(SCR *sp, MARK *mp)
62 v_emsg(sp, NULL, VIM_EOL);
64 if (db_get(sp, mp->lno, DBG_FATAL, NULL, &len))
66 if (mp->cno == len - 1)
67 v_emsg(sp, NULL, VIM_EOL);
69 msgq(sp, M_BERR, "196|Movement past the end-of-line");
75 * Vi no cursor movement error.
77 * PUBLIC: void v_nomove(SCR *);
82 msgq(sp, M_BERR, "197|No cursor movement made");
87 * Vi start-of-file error.
89 * PUBLIC: void v_sof(SCR *, MARK *);
92 v_sof(SCR *sp, MARK *mp)
94 if (mp == NULL || mp->lno == 1)
95 msgq(sp, M_BERR, "198|Already at the beginning of the file");
97 msgq(sp, M_BERR, "199|Movement past the beginning of the file");
102 * Vi start-of-line error.
104 * PUBLIC: void v_sol(SCR *);
109 msgq(sp, M_BERR, "200|Already in the first column");
114 * Return if the line contains nothing but white-space characters.
116 * PUBLIC: int v_isempty(CHAR_T *, size_t);
119 v_isempty(CHAR_T *p, size_t len)
129 * Display a few common vi messages.
131 * PUBLIC: void v_emsg(SCR *, char *, vim_t);
134 v_emsg(SCR *sp, char *p, vim_t which)
139 "201|Buffers should be specified before the command");
142 msgq(sp, M_BERR, "209|The file is empty");
145 msgq(sp, M_BERR, "202|Already at end-of-file");
148 msgq(sp, M_BERR, "203|Already at end-of-line");
153 which == VIM_NOCOM_B ? M_BERR : M_ERR,
154 "204|%s isn't a vi command", p);
157 msgq(sp, M_ERR, "Window resize interrupted text input mode");
160 msgq(sp, M_ERR, "205|Usage: %s", p);