To: vim-dev@vim.org Subject: Patch 6.1.171 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.171 Problem: When opening a line just above a closed fold with "O" and the comment leader is automatically inserted, the cursor is displayed in the first column. (Sung-Hyun Nam) Solution: Update the flag that indicates the cursor is in a closed fold. Files: src/misc1.c *** ../vim61.170/src/misc1.c Sat Aug 3 21:22:36 2002 --- src/misc1.c Thu Aug 29 22:02:33 2002 *************** *** 2317,2325 **** /* The change may cause lines above or below the change to become * included in a fold. Set lnum/lnume to the first/last line that ! * might be displayed differently. */ ! hasFoldingWin(wp, lnum, &lnum, NULL, FALSE, NULL); ! hasFoldingWin(wp, lnume, NULL, &lnume, FALSE, NULL); /* If the changed line is in a range of previously folded lines, * compare with the first line in that range. */ --- 2317,2331 ---- /* The change may cause lines above or below the change to become * included in a fold. Set lnum/lnume to the first/last line that ! * might be displayed differently. ! * Set w_cline_folded here as an efficient way to update it when ! * inserting lines just above a closed fold. */ ! i = hasFoldingWin(wp, lnum, &lnum, NULL, FALSE, NULL); ! if (wp->w_cursor.lnum == lnum) ! wp->w_cline_folded = i; ! i = hasFoldingWin(wp, lnume, NULL, &lnume, FALSE, NULL); ! if (wp->w_cursor.lnum == lnume) ! wp->w_cline_folded = i; /* If the changed line is in a range of previously folded lines, * compare with the first line in that range. */ *** ../vim61.170/src/version.c Fri Aug 30 22:33:37 2002 --- src/version.c Fri Aug 30 22:34:52 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 171, /**/ -- ARTHUR: Well, it doesn't matter. Will you go and tell your master that Arthur from the Court of Camelot is here. GUARD #1: Listen, in order to maintain air-speed velocity, a swallow needs to beat its wings 43 times every second, right? ARTHUR: Please! The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///