| To: vim-dev@vim.org |
| Subject: patch 7.0.181 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.0.181 |
| Problem: When reloading a file that starts with an empty line, the reloaded |
| buffer has an extra empty line at the end. (Motty Lentzitzky) |
| Solution: Delete all lines, don't use bufempty(). |
| Files: src/fileio.c |
| |
| |
| |
| |
| |
| *** 6178,6185 **** |
| if (retval != FAIL) |
| { |
| curbuf = frombuf; |
| ! while (!bufempty()) |
| ! if (ml_delete(curbuf->b_ml.ml_line_count, FALSE) == FAIL) |
| { |
| /* Oops! We could try putting back the saved lines, but that |
| * might fail again... */ |
| --- 6179,6186 ---- |
| if (retval != FAIL) |
| { |
| curbuf = frombuf; |
| ! for (lnum = curbuf->b_ml.ml_line_count; lnum > 0; --lnum) |
| ! if (ml_delete(lnum, FALSE) == FAIL) |
| { |
| /* Oops! We could try putting back the saved lines, but that |
| * might fail again... */ |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 181, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 11. You find yourself typing "com" after every period when using a word |
| processor.com |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |