diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-08-15 21:41:48 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-08-15 21:41:48 +0000 |
commit | ae5bce1c127136a650ee25c4c78d3d334cc07859 (patch) | |
tree | 992edb0baaa4a6a4156fbfb77d4f6382cd3f5999 /src/ex_getln.c | |
parent | 90cfdbe040320952e6b542d0633987f082b0f158 (diff) | |
download | vim-git-ae5bce1c127136a650ee25c4c78d3d334cc07859.tar.gz |
updated for version 7.0130v7.0130
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 5ba7d8b07..cd40a689d 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1647,16 +1647,21 @@ cmdline_changed: if (i != 0) { + pos_T save_pos = curwin->w_cursor; + /* * First move cursor to end of match, then to start. This * moves the whole match onto the screen when 'nowrap' is set. */ - i = curwin->w_cursor.col; curwin->w_cursor.lnum += search_match_lines; curwin->w_cursor.col = search_match_endcol; + if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) + { + curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; + coladvance((colnr_T)MAXCOL); + } validate_cursor(); - curwin->w_cursor.lnum -= search_match_lines; - curwin->w_cursor.col = i; + curwin->w_cursor = save_pos; } validate_cursor(); |