home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.1.143 < prev    next >
Encoding:
Internet Message Format  |  2002-07-31  |  2.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.143
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.143 (depends on 6.1.142)
  11. Problem:    Auto formatting near the end of the file moves the cursor to a
  12.         wrong position.  In Insert mode some lines are made one char too
  13.         narrow.  When deleting a line undo might not always work properly.
  14. Solution:   Don't always move to the end of the line in the last line.  Don't
  15.         position the cursor past the end of the line in Insert mode.
  16.         After deleting a line save the cursor line for undo.
  17. Files:        src/edit.c, src/ops.c, src/normal.c
  18.  
  19.  
  20. *** ../vim61.142/src/edit.c    Sun Jul 28 22:02:42 2002
  21. --- src/edit.c    Tue Jul 30 19:22:21 2002
  22. ***************
  23. *** 4256,4262 ****
  24.       pold = old;
  25.       while (1)
  26.       {
  27. !     if (curwin->w_cursor.lnum >= curbuf->b_ml.ml_line_count)
  28.       {
  29.           curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
  30.           curwin->w_cursor.col = MAXCOL;
  31. --- 4256,4262 ----
  32.       pold = old;
  33.       while (1)
  34.       {
  35. !     if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
  36.       {
  37.           curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
  38.           curwin->w_cursor.col = MAXCOL;
  39. *** ../vim61.142/src/ops.c    Sun Jul 28 22:02:42 2002
  40. --- src/ops.c    Thu Aug  1 20:17:00 2002
  41. ***************
  42. *** 4200,4205 ****
  43. --- 4200,4206 ----
  44.               (void)set_indent(get_indent(), SIN_CHANGED);
  45.   
  46.           /* put cursor on last non-space */
  47. +         State = NORMAL;    /* don't go past end-of-line */
  48.           coladvance((colnr_T)MAXCOL);
  49.           while (curwin->w_cursor.col && vim_isspace(gchar_cursor()))
  50.               dec_cursor();
  51. *** ../vim61.142/src/normal.c    Sun Jul 28 22:02:42 2002
  52. --- src/normal.c    Thu Aug  1 20:39:05 2002
  53. ***************
  54. *** 1727,1732 ****
  55. --- 1727,1734 ----
  56.           else
  57.           {
  58.           (void)op_delete(oap);
  59. +         if (oap->motion_type == MLINE && has_format_option(FO_AUTO))
  60. +             u_save_cursor();        /* cursor line wasn't saved yet */
  61.           auto_format();
  62.           }
  63.           break;
  64. *** ../vim61.142/src/version.c    Sun Jul 28 22:02:42 2002
  65. --- src/version.c    Thu Aug  1 20:45:20 2002
  66. ***************
  67. *** 608,609 ****
  68. --- 608,611 ----
  69.   {   /* Add new patch number below this line */
  70. + /**/
  71. +     143,
  72.   /**/
  73.  
  74. -- 
  75. From "know your smileys":
  76.  (:-#    Said something he shouldn't have
  77.  
  78.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  79. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  80. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  81.  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
  82.