To: vim-dev@vim.org Subject: Patch 6.2.401 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.401 Problem: When opening a buffer that was previously opened, Vim does not restore the cursor position if the first line starts with white space. (Gregory Margo) Solution: Don't skip restoring the cursor position if it is past the blanks in the first line. Files: src/buffer.c *** ../vim-6.2.400/src/buffer.c Sun Feb 15 13:29:04 2004 --- src/buffer.c Thu Mar 25 13:09:55 2004 *************** *** 1340,1346 **** /* If autocommands did not change the cursor position, restore cursor lnum * and possibly cursor col. */ ! if (curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0) buflist_getfpos(); check_arg_idx(curwin); /* check for valid arg_idx */ --- 1340,1346 ---- /* If autocommands did not change the cursor position, restore cursor lnum * and possibly cursor col. */ ! if (curwin->w_cursor.lnum == 1 && inindent(0)) buflist_getfpos(); check_arg_idx(curwin); /* check for valid arg_idx */ *** ../vim-6.2.400/src/version.c Thu Mar 25 19:25:28 2004 --- src/version.c Thu Mar 25 19:26:30 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 401, /**/ -- hundred-and-one symptoms of being an internet addict: 142. You dream about creating the world's greatest web site. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///