To: vim-dev@vim.org Subject: Patch 6.1.302 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.302 Problem: Counting lines of the Visual area is incorrect for closed folds. (Mikolaj Machowski) Solution: Correct the start and end for the closed fold. Files: src/normal.c *** ../vim61.301/src/normal.c Sun Jan 5 14:14:45 2003 --- src/normal.c Sun Jan 26 22:40:10 2003 *************** *** 3248,3262 **** #ifdef FEAT_VISUAL if (VIsual_active) { ! int i = lt(VIsual, curwin->w_cursor); ! long lines; ! colnr_T leftcol, rightcol; /* Show the size of the Visual area. */ if (i) ! lines = curwin->w_cursor.lnum - VIsual.lnum + 1; else ! lines = VIsual.lnum - curwin->w_cursor.lnum + 1; if (VIsual_mode == Ctrl_V) { getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol); --- 3248,3276 ---- #ifdef FEAT_VISUAL if (VIsual_active) { ! int i = lt(VIsual, curwin->w_cursor); ! long lines; ! colnr_T leftcol, rightcol; ! linenr_T top, bot; /* Show the size of the Visual area. */ if (i) ! { ! top = VIsual.lnum; ! bot = curwin->w_cursor.lnum; ! } else ! { ! top = curwin->w_cursor.lnum; ! bot = VIsual.lnum; ! } ! # ifdef FEAT_FOLDING ! /* Include closed folds as a whole. */ ! hasFolding(top, &top, NULL); ! hasFolding(bot, NULL, &bot); ! # endif ! lines = bot - top + 1; ! if (VIsual_mode == Ctrl_V) { getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol); *** ../vim61.301/src/version.c Thu Jan 23 22:09:25 2003 --- src/version.c Sun Jan 26 22:40:46 2003 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 302, /**/ -- Never overestimate a man's ability to underestimate a woman. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///