0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.0049

This commit is contained in:
Bram Moolenaar
2005-02-07 22:01:03 +00:00
parent f97ca8f066
commit 7c62692d43
28 changed files with 796 additions and 190 deletions

View File

@@ -5151,7 +5151,9 @@ cursor_up(n, upd_topline)
if (n > 0)
{
lnum = curwin->w_cursor.lnum;
if (lnum <= 1)
/* This fails if the cursor is already in the first line or the count
* is larger than the line number and '-' is in 'cpoptions' */
if (lnum <= 1 || (n >= lnum && vim_strchr(p_cpo, CPO_MINUS) != NULL))
return FAIL;
if (n >= lnum)
lnum = 1;
@@ -5212,7 +5214,11 @@ cursor_down(n, upd_topline)
/* Move to last line of fold, will fail if it's the end-of-file. */
(void)hasFolding(lnum, NULL, &lnum);
#endif
if (lnum >= curbuf->b_ml.ml_line_count)
/* This fails if the cursor is already in the last line or would move
* beyound the last line and '-' is in 'cpoptions' */
if (lnum >= curbuf->b_ml.ml_line_count
|| (lnum + n > curbuf->b_ml.ml_line_count
&& vim_strchr(p_cpo, CPO_MINUS) != NULL))
return FAIL;
if (lnum + n >= curbuf->b_ml.ml_line_count)
lnum = curbuf->b_ml.ml_line_count;