comparison src/memline.c @ 1068:efd0ce477ae7 v7.0.194

updated for version 7.0-194
author vimboss
date Tue, 13 Feb 2007 03:01:39 +0000
parents bffbbb566d6b
children 342d2b3a072a
comparison
equal deleted inserted replaced
1067:0b056c1350dd 1068:efd0ce477ae7
2052 ml_get_buf(buf, lnum, will_change) 2052 ml_get_buf(buf, lnum, will_change)
2053 buf_T *buf; 2053 buf_T *buf;
2054 linenr_T lnum; 2054 linenr_T lnum;
2055 int will_change; /* line will be changed */ 2055 int will_change; /* line will be changed */
2056 { 2056 {
2057 bhdr_T *hp; 2057 bhdr_T *hp;
2058 DATA_BL *dp; 2058 DATA_BL *dp;
2059 char_u *ptr; 2059 char_u *ptr;
2060 static int recursive = 0;
2060 2061
2061 if (lnum > buf->b_ml.ml_line_count) /* invalid line number */ 2062 if (lnum > buf->b_ml.ml_line_count) /* invalid line number */
2062 { 2063 {
2063 EMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum); 2064 if (recursive == 0)
2065 {
2066 /* Avoid giving this message for a recursive call, may happen when
2067 * the GUI redraws part of the text. */
2068 ++recursive;
2069 EMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum);
2070 --recursive;
2071 }
2064 errorret: 2072 errorret:
2065 STRCPY(IObuff, "???"); 2073 STRCPY(IObuff, "???");
2066 return IObuff; 2074 return IObuff;
2067 } 2075 }
2068 if (lnum <= 0) /* pretend line 0 is line 1 */ 2076 if (lnum <= 0) /* pretend line 0 is line 1 */
2086 * This also fills the stack with the blocks from the root to the data 2094 * This also fills the stack with the blocks from the root to the data
2087 * block and releases any locked block. 2095 * block and releases any locked block.
2088 */ 2096 */
2089 if ((hp = ml_find_line(buf, lnum, ML_FIND)) == NULL) 2097 if ((hp = ml_find_line(buf, lnum, ML_FIND)) == NULL)
2090 { 2098 {
2091 EMSGN(_("E316: ml_get: cannot find line %ld"), lnum); 2099 if (recursive == 0)
2100 {
2101 /* Avoid giving this message for a recursive call, may happen
2102 * when the GUI redraws part of the text. */
2103 ++recursive;
2104 EMSGN(_("E316: ml_get: cannot find line %ld"), lnum);
2105 --recursive;
2106 }
2092 goto errorret; 2107 goto errorret;
2093 } 2108 }
2094 2109
2095 dp = (DATA_BL *)(hp->bh_data); 2110 dp = (DATA_BL *)(hp->bh_data);
2096 2111