summaryrefslogtreecommitdiff
path: root/src/memline.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-02-13 03:01:39 +0000
committerBram Moolenaar <Bram@vim.org>2007-02-13 03:01:39 +0000
commitad40f02cd9a306924352c1647186ce745489fcfb (patch)
treec2aa030fed8b0f6d4047a52667c939e974422bf7 /src/memline.c
parentb01a8b749b1df035da491efca311ef50fd3d57eb (diff)
downloadvim-git-ad40f02cd9a306924352c1647186ce745489fcfb.tar.gz
updated for version 7.0-194v7.0.194
Diffstat (limited to 'src/memline.c')
-rw-r--r--src/memline.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/memline.c b/src/memline.c
index 6f59a9a9c..d0eb0f8bf 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -2054,13 +2054,21 @@ ml_get_buf(buf, lnum, will_change)
linenr_T lnum;
int will_change; /* line will be changed */
{
- bhdr_T *hp;
- DATA_BL *dp;
- char_u *ptr;
+ bhdr_T *hp;
+ DATA_BL *dp;
+ char_u *ptr;
+ static int recursive = 0;
if (lnum > buf->b_ml.ml_line_count) /* invalid line number */
{
- EMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum);
+ if (recursive == 0)
+ {
+ /* Avoid giving this message for a recursive call, may happen when
+ * the GUI redraws part of the text. */
+ ++recursive;
+ EMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum);
+ --recursive;
+ }
errorret:
STRCPY(IObuff, "???");
return IObuff;
@@ -2088,7 +2096,14 @@ errorret:
*/
if ((hp = ml_find_line(buf, lnum, ML_FIND)) == NULL)
{
- EMSGN(_("E316: ml_get: cannot find line %ld"), lnum);
+ if (recursive == 0)
+ {
+ /* Avoid giving this message for a recursive call, may happen
+ * when the GUI redraws part of the text. */
+ ++recursive;
+ EMSGN(_("E316: ml_get: cannot find line %ld"), lnum);
+ --recursive;
+ }
goto errorret;
}