Mercurial > vim
comparison src/normal.c @ 9:4102fb4ea781 v7.0002
updated for version 7.0002
author | vimboss |
---|---|
date | Sun, 20 Jun 2004 12:51:53 +0000 |
parents | 3fc0f57ecb91 |
children | 4424b47a0797 |
comparison
equal
deleted
inserted
replaced
8:7edf9b6e4c36 | 9:4102fb4ea781 |
---|---|
5184 validate_botline(); /* make sure curwin->w_botline is valid */ | 5184 validate_botline(); /* make sure curwin->w_botline is valid */ |
5185 curwin->w_cursor.lnum = curwin->w_botline - 1; | 5185 curwin->w_cursor.lnum = curwin->w_botline - 1; |
5186 if (cap->count1 - 1 >= curwin->w_cursor.lnum) | 5186 if (cap->count1 - 1 >= curwin->w_cursor.lnum) |
5187 curwin->w_cursor.lnum = 1; | 5187 curwin->w_cursor.lnum = 1; |
5188 else | 5188 else |
5189 curwin->w_cursor.lnum -= cap->count1 - 1; | 5189 { |
5190 #ifdef FEAT_FOLDING | |
5191 if (hasAnyFolding(curwin)) | |
5192 { | |
5193 /* Count a fold for one screen line. */ | |
5194 for (n = cap->count1 - 1; n > 0 | |
5195 && curwin->w_cursor.lnum > curwin->w_topline; --n) | |
5196 { | |
5197 (void)hasFolding(curwin->w_cursor.lnum, | |
5198 &curwin->w_cursor.lnum, NULL); | |
5199 --curwin->w_cursor.lnum; | |
5200 } | |
5201 } | |
5202 else | |
5203 #endif | |
5204 curwin->w_cursor.lnum -= cap->count1 - 1; | |
5205 } | |
5190 } | 5206 } |
5191 else | 5207 else |
5192 { | 5208 { |
5193 if (cap->cmdchar == 'M') | 5209 if (cap->cmdchar == 'M') |
5194 { | 5210 { |
5220 #endif | 5236 #endif |
5221 } | 5237 } |
5222 if (n > 0 && used > curwin->w_height) | 5238 if (n > 0 && used > curwin->w_height) |
5223 --n; | 5239 --n; |
5224 } | 5240 } |
5225 else | 5241 else /* (cap->cmdchar == 'H') */ |
5242 { | |
5226 n = cap->count1 - 1; | 5243 n = cap->count1 - 1; |
5244 #ifdef FEAT_FOLDING | |
5245 if (hasAnyFolding(curwin)) | |
5246 { | |
5247 /* Count a fold for one screen line. */ | |
5248 lnum = curwin->w_topline; | |
5249 while (n-- > 0 && lnum < curwin->w_botline - 1) | |
5250 { | |
5251 hasFolding(lnum, NULL, &lnum); | |
5252 ++lnum; | |
5253 } | |
5254 n = lnum - curwin->w_topline; | |
5255 } | |
5256 #endif | |
5257 } | |
5227 curwin->w_cursor.lnum = curwin->w_topline + n; | 5258 curwin->w_cursor.lnum = curwin->w_topline + n; |
5228 if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) | 5259 if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) |
5229 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; | 5260 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; |
5230 } | 5261 } |
5231 | 5262 |