This commit is contained in:
James McCoy 2017-12-15 15:57:38 -05:00
parent d5bce42b52
commit dcb2780b83
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
2 changed files with 21 additions and 24 deletions

View File

@ -1743,11 +1743,11 @@ ml_get_buf (
if (lnum > buf->b_ml.ml_line_count) { /* invalid line number */
if (recursive == 0) {
/* Avoid giving this message for a recursive call, may happen when
* the GUI redraws part of the text. */
++recursive;
// Avoid giving this message for a recursive call, may happen when
// the GUI redraws part of the text.
recursive++;
IEMSGN(_("E315: ml_get: invalid lnum: %" PRId64), lnum);
--recursive;
recursive--;
}
errorret:
STRCPY(IObuff, "???");
@ -1775,11 +1775,11 @@ errorret:
*/
if ((hp = ml_find_line(buf, lnum, ML_FIND)) == NULL) {
if (recursive == 0) {
/* Avoid giving this message for a recursive call, may happen
* when the GUI redraws part of the text. */
++recursive;
// Avoid giving this message for a recursive call, may happen
// when the GUI redraws part of the text.
recursive++;
IEMSGN(_("E316: ml_get: cannot find line %" PRId64), lnum);
--recursive;
recursive--;
}
goto errorret;
}
@ -2631,9 +2631,9 @@ static void ml_flush_line(buf_T *buf)
new_line = buf->b_ml.ml_line_ptr;
hp = ml_find_line(buf, lnum, ML_FIND);
if (hp == NULL)
if (hp == NULL) {
IEMSGN(_("E320: Cannot find line %" PRId64), lnum);
else {
} else {
dp = hp->bh_data;
idx = lnum - buf->b_ml.ml_locked_low;
start = ((dp->db_index[idx]) & DB_INDEX_MASK);
@ -2879,13 +2879,14 @@ static bhdr_T *ml_find_line(buf_T *buf, linenr_T lnum, int action)
break;
}
}
if (idx >= (int)pp->pb_count) { /* past the end: something wrong! */
if (lnum > buf->b_ml.ml_line_count)
if (idx >= (int)pp->pb_count) { // past the end: something wrong!
if (lnum > buf->b_ml.ml_line_count) {
IEMSGN(_("E322: line number out of range: %" PRId64 " past the end"),
lnum - buf->b_ml.ml_line_count);
lnum - buf->b_ml.ml_line_count);
else
} else {
IEMSGN(_("E323: line count wrong in block %" PRId64), bnum);
}
goto error_block;
}
if (action == ML_DELETE) {

View File

@ -458,17 +458,13 @@ static int toggle_Magic(int x)
/* Used for an error (down from) vim_regcomp(): give the error message, set
* rc_did_emsg and return NULL */
#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = TRUE, (void *)NULL)
#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = true, (void *)NULL)
#define IEMSG_RET_NULL(m) return (IEMSG(m), rc_did_emsg = true, (void *)NULL)
#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = TRUE, FAIL)
#define EMSG2_RET_NULL(m, \
c) return (EMSG2((m), \
(c) ? "" : "\\"), rc_did_emsg = true, \
(void *)NULL)
#define EMSG2_RET_FAIL(m, \
c) return (EMSG2((m), \
(c) ? "" : "\\"), rc_did_emsg = true, \
FAIL)
#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = true, FAIL)
#define EMSG2_RET_NULL(m, c) \
return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = true, (void *)NULL)
#define EMSG2_RET_FAIL(m, c) \
return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = true, FAIL)
#define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_( \
"E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)